-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.js
26 lines (24 loc) · 1.07 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const GetUserDataHandler = require('./src/Instagram/Application/GetUserDataHandler');
const GetPostDataHandler = require('./src/Instagram/Application/GetPostDataHandler');
const AuthenticationHandler = require('./src/Instagram/Application/AuthenticationHandler');
const GetUserDataQuery = require('./src/Instagram/Application/Query/GetUserDataQuery');
const GetPostDataQuery = require('./src/Instagram/Application/Query/GetPostDataQuery');
const AuthenticationQuery = require('./src/Instagram/Application/Query/AuthenticationQuery');
module.exports = {
/**
* @param {string} username
* @returns Promise<User>
*/
getUserData: (username) => GetUserDataHandler.handle(new GetUserDataQuery(username)),
/**
* @param {string} shortCode
* @returns {Promise<Post>}
*/
getPostData: (shortCode) => GetPostDataHandler.handle(new GetPostDataQuery(shortCode)),
/**
* @param {string} username
* @param {string} password
* @returns {Promise<void>}
*/
authenticate: (username, password) => AuthenticationHandler.handle(new AuthenticationQuery(username, password))
};