Skip to content

Commit

Permalink
Merge pull request #234 from slackhq/update_api_facets
Browse files Browse the repository at this point in the history
Updates the API facets to latest
  • Loading branch information
Leah Jones authored Jun 15, 2016
2 parents 43500e8 + e163fb1 commit b267569
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v3.5.0 (2016-06-14)

* Adds the [team.billableInfo](https://api.slack.com/methods/team.billableInfo) endpoint to the team facet
* Adds the [bots.info](https://api.slack.com/methods/bots.info) endpoint and creates the `bots` facet
* Removes the `user` optional argument from the [stars.list](https://api.slack.com/methods/stars.list) method

### v3.4.0 (2016-05-31)

* Adds the [chat.meMessage](https://api.slack.com/methods/chat.meMessage) endpoint to the chat facet
Expand Down
29 changes: 29 additions & 0 deletions lib/clients/web/facets/bots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* API Facet to make calls to methods in the bots namespace.
*
* This provides functions to call:
* - info: {@link https://api.slack.com/methods/bots.info|bots.info}
*
*/


function BotsFacet(makeAPICall) {
this.name = 'bots';
this.makeAPICall = makeAPICall;
}


/**
* Gets information about a bot user.
* @see {@link https://api.slack.com/methods/bots.info|bots.info}
*
* @param {Object=} opts
* @param {?} opts.bot - Bot user to get info on
* @param {function=} optCb Optional callback, if not using promises.
*/
BotsFacet.prototype.info = function info(opts, optCb) {
return this.makeAPICall('bots.info', null, opts, optCb);
};


module.exports = BotsFacet;
1 change: 1 addition & 0 deletions lib/clients/web/facets/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
ApiFacet: require('./api.js'),
AuthFacet: require('./auth.js'),
BotsFacet: require('./bots'),
ChannelsFacet: require('./channels.js'),
ChatFacet: require('./chat.js'),
DndFacet: require('./dnd.js'),
Expand Down
1 change: 0 additions & 1 deletion lib/clients/web/facets/stars.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ StarsFacet.prototype.add = function add(opts, optCb) {
* @see {@link https://api.slack.com/methods/stars.list|stars.list}
*
* @param {Object=} opts
* @param {?} opts.user - Show stars by this user. Defaults to the authed user.
* @param {function=} optCb Optional callback, if not using promises.
Expand Down
14 changes: 14 additions & 0 deletions lib/clients/web/facets/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* This provides functions to call:
* - accessLogs: {@link https://api.slack.com/methods/team.accessLogs|team.accessLogs}
* - billableInfo: {@link https://api.slack.com/methods/team.billableInfo|team.billableInfo}
* - info: {@link https://api.slack.com/methods/team.info|team.info}
* - integrationLogs: {@link https://api.slack.com/methods/team.integrationLogs|team.integrationLogs}
*
Expand All @@ -29,6 +30,19 @@ TeamFacet.prototype.accessLogs = function accessLogs(opts, optCb) {
};


/**
* Gets billable users information for the current team.
* @see {@link https://api.slack.com/methods/team.billableInfo|team.billableInfo}
*
* @param {Object=} opts
* @param {?} opts.user - A user to retrieve the billable information for. Defaults to all users.
* @param {function=} optCb Optional callback, if not using promises.
*/
TeamFacet.prototype.billableInfo = function billableInfo(opts, optCb) {
return this.makeAPICall('team.billableInfo', null, opts, optCb);
};


/**
* Gets information about the current team.
* @see {@link https://api.slack.com/methods/team.info|team.info}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@slack/client",
"version": "3.4.0",
"version": "3.5.0",
"description": "A library for creating a Slack client",
"main": "./index",
"scripts": {
"lint": "eslint . --ignore-path .gitignore",
"mocha": "mocha --recursive --reporter spec test",
"test": "npm run mocha && npm run lint",
"cover": "istanbul cover --report lcovonly _mocha -- --recursive",
"cover": "istanbul cover -x **/facets/*.js --report lcovonly _mocha -- --recursive",
"coveralls": "npm run cover && istanbul-coveralls",
"make-slack-client-symlink": "mkdir -p $PWD/node_modules/@slack/client && ln -s $PWD/index.js $PWD/node_modules/@slack/client/index.js"
},
Expand Down

0 comments on commit b267569

Please sign in to comment.