Socket
Socket
Sign inDemoInstall

@slack/client

Package Overview
Dependencies
67
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.4.0 to 3.5.0

lib/clients/web/facets/bots.js

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 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)

@@ -2,0 +8,0 @@

1

lib/clients/web/facets/index.js
module.exports = {
ApiFacet: require('./api.js'),
AuthFacet: require('./auth.js'),
BotsFacet: require('./bots'),
ChannelsFacet: require('./channels.js'),

@@ -5,0 +6,0 @@ ChatFacet: require('./chat.js'),

1

lib/clients/web/facets/stars.js

@@ -40,3 +40,2 @@ /**

* @param {Object=} opts
* @param {?} opts.user - Show stars by this user. Defaults to the authed user.

@@ -43,0 +42,0 @@

@@ -6,2 +6,3 @@ /**

* - 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}

@@ -34,2 +35,15 @@ * - integrationLogs: {@link https://api.slack.com/methods/team.integrationLogs|team.integrationLogs}

/**
* 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.

@@ -36,0 +50,0 @@ * @see {@link https://api.slack.com/methods/team.info|team.info}

@@ -97,2 +97,11 @@ /* eslint no-unused-vars: 0 */

/**
* Returns the User object matching the supplied bot ID.
* @param {string} botId
* @returns {Object}
*/
SlackDataStore.prototype.getUserByBotId = function getUserByBotId(botId) {
};
/**
* Returns the Channel object matching the supplied id.

@@ -150,3 +159,2 @@ * @param channelId

SlackDataStore.prototype.getDMByName = function getDMByName(name) {
};

@@ -161,3 +169,2 @@

SlackDataStore.prototype.getBotById = function getBotById(botId) {
};

@@ -172,3 +179,11 @@

SlackDataStore.prototype.getBotByName = function getBotByName(name) {
};
/**
* Returns the bot object matching the supplied user ID.
* @param userId
* @returns {Object}
*/
SlackDataStore.prototype.getBotByUserId = function getBotByUserId(userId) {
};

@@ -183,3 +198,2 @@

SlackDataStore.prototype.getTeamById = function getTeamById(name) {
};

@@ -186,0 +200,0 @@

@@ -96,2 +96,8 @@ /**

/** @inheritdoc */
SlackMemoryDataStore.prototype.getUserByBotId = function getUserByBotId(botId) {
return find(this.users, { profile: { bot_id: botId } });
};
/** @inheritdoc */
SlackMemoryDataStore.prototype.getChannelById = function getChannelById(channelId) {

@@ -147,2 +153,13 @@ return this.channels[channelId];

/** @inheritdoc */
SlackMemoryDataStore.prototype.getBotByUserId = function getBotByUserId(userId) {
var bot;
var user = this.getUserById(userId);
if (user) {
bot = this.getBotById(user.profile.bot_id);
}
return bot;
};
/** @inheritdoc */
SlackMemoryDataStore.prototype.getTeamById = function getTeamById(teamId) {

@@ -149,0 +166,0 @@ return this.teams[teamId];

{
"name": "@slack/client",
"version": "3.4.0",
"version": "3.5.0",
"description": "A library for creating a Slack client",

@@ -10,3 +10,3 @@ "main": "./index",

"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",

@@ -13,0 +13,0 @@ "make-slack-client-symlink": "mkdir -p $PWD/node_modules/@slack/client && ln -s $PWD/index.js $PWD/node_modules/@slack/client/index.js"

@@ -86,2 +86,26 @@ var expect = require('chai').expect;

describe('#getUserByBotId()', function () {
var dataStore = getMemoryDataStore();
it('should get a bot user by bot ID', function () {
expect(dataStore.getUserByBotId('B0EV07BEH').id).to.equal('U0EUYE1E0');
});
it('should return undefined if no users with a bot id are found', function () {
expect(dataStore.getUserByEmail('B00000000')).to.equal(undefined);
});
});
describe('#getBotByUserId()', function () {
var dataStore = getMemoryDataStore();
it('should get a bot user by user ID', function () {
expect(dataStore.getBotByUserId('U0EUYE1E0').id).to.equal('B0EV07BEH');
});
it('should return undefined if no bots with a user id are found', function () {
expect(dataStore.getBotByUserId('U00000000')).to.equal(undefined);
});
});
describe('#clear()', function () {

@@ -88,0 +112,0 @@ it('should re-set the objects when clear() is called', function () {

@@ -502,2 +502,39 @@ {

"presence": "active"
},
{
"id": "U0EUYE1E0",
"team_id": "T0CHZBU59",
"name": "test-bot",
"deleted": false,
"status": null,
"color": "3c989f",
"real_name": "Test Bot",
"tz": null,
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"bot_id": "B0EV07BEH",
"image_24": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_24.jpg",
"image_32": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_32.jpg",
"image_48": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_48.jpg",
"image_72": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_72.jpg",
"image_192": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_192.jpg",
"image_512": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_512.jpg",
"image_1024": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_512.jpg",
"image_original": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_original.jpg",
"first_name": "Test",
"last_name": "Bot",
"title": "bot-stuff",
"avatar_hash": "24078e22bcd7",
"real_name": "Test Bot",
"real_name_normalized": "Test Bot",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": true,
"presence": "away"
}

@@ -512,2 +549,12 @@ ],

"name": "gdrive"
},
{
"id": "B0EV07BEH",
"deleted": false,
"name": "bot",
"icons": {
"image_36": "https://a.slack-edge.com/2fac/plugins/bot/assets/service_36.png",
"image_48": "https://a.slack-edge.com/2fac/plugins/bot/assets/service_48.png",
"image_72": "https://a.slack-edge.com/12b5a/plugins/bot/assets/service_72.png"
}
}

@@ -514,0 +561,0 @@ ],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc