-
Notifications
You must be signed in to change notification settings - Fork 662
/
team.js
61 lines (47 loc) · 1.88 KB
/
team.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* API Facet to make calls to methods in the team namespace.
*
* This provides functions to call:
* - accessLogs: {@link https://api.slack.com/methods/team.accessLogs|team.accessLogs}
* - info: {@link https://api.slack.com/methods/team.info|team.info}
* - integrationLogs: {@link https://api.slack.com/methods/team.integrationLogs|team.integrationLogs}
*
*/
function TeamFacet(makeAPICall) {
this.name = 'team';
this.makeAPICall = makeAPICall;
}
/**
* Gets the access logs for the current team.
* @see {@link https://api.slack.com/methods/team.accessLogs|team.accessLogs}
*
* @param {Object=} opts
* @param {function=} optCb Optional callback, if not using promises.
*/
TeamFacet.prototype.accessLogs = function accessLogs(opts, optCb) {
return this.makeAPICall('team.accessLogs', null, opts, optCb);
};
/**
* Gets information about the current team.
* @see {@link https://api.slack.com/methods/team.info|team.info}
*
* @param {function=} optCb Optional callback, if not using promises.
*/
TeamFacet.prototype.info = function info(optCb) {
return this.makeAPICall('team.info', null, null, optCb);
};
/**
* Gets the integration logs for the current team.
* @see {@link https://api.slack.com/methods/team.integrationLogs|team.integrationLogs}
*
* @param {Object=} opts
* @param {?} opts.service_id - Filter logs to this service. Defaults to all logs.
* @param {?} opts.app_id - Filter logs to this Slack app. Defaults to all logs.
* @param {?} opts.user - Filter logs generated by this user’s actions. Defaults to all logs.
* @param {?} opts.change_type - Filter logs with this change type. Defaults to all logs.
* @param {function=} optCb Optional callback, if not using promises.
*/
TeamFacet.prototype.integrationLogs = function integrationLogs(opts, optCb) {
return this.makeAPICall('team.integrationLogs', null, opts, optCb);
};
module.exports = TeamFacet;