-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (30 loc) · 922 Bytes
/
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
27
28
29
30
31
32
33
34
35
const rootPrefix = '.',
GetStats = require(rootPrefix + '/lib/GetStats'),
configProvider = require(rootPrefix + '/lib/configProvider');
/**
* Class exposed by this package
*
* @class BrandMonitoring
*/
class BrandMonitoring {
constructor(twitterApiConfig, awsComprehendConfig) {
// Saving the params in-memory via configProvider
configProvider.setConfig('twitterApiConfig', twitterApiConfig);
configProvider.setConfig('awsComprehendConfig', awsComprehendConfig);
}
/**
* Get statistics.
*
* @return {Promise<void>}
*/
getStats(reportParams) {
const params = {
twitterUsername: reportParams.twitterUsername,
startTimestamp: reportParams.startTimestamp,
endTimestamp: reportParams.endTimestamp
};
configProvider.setConfig('awsThreshold', reportParams.awsThreshold);
return new GetStats(params).perform();
}
}
module.exports = BrandMonitoring;