Răsfoiți Sursa

WIP: replace slack libs

* refactor post method
* use 'slack-node' instead of '@slack/client'
Yuki Takei 8 ani în urmă
părinte
comite
46a688159e
4 a modificat fișierele cu 150 adăugiri și 257 ștergeri
  1. 4 2
      lib/routes/page.js
  2. 93 125
      lib/util/slack.js
  3. 1 1
      package.json
  4. 52 129
      yarn.lock

+ 4 - 2
lib/routes/page.js

@@ -620,8 +620,10 @@ module.exports = function(crowi, app) {
 
           if (crowi.slack) {
             notify.slack.channel.split(',').map(function(chan) {
-              var message = crowi.slack.prepareSlackMessage(pageData, req.user, chan, updateOrCreate, previousRevision);
-              crowi.slack.post(message.channel, message.text, message).then(function(){}).catch(function(){});
+              crowi.slack.post(pageData, req.user, chan, updateOrCreate, previousRevision)
+                .catch((err) => {
+                  debug(err);
+                });
             });
           }
         }

+ 93 - 125
lib/util/slack.js

@@ -8,128 +8,23 @@ module.exports = function(crowi) {
   const SLACK_URL = 'https://slack.com';
 
   const debug = require('debug')('crowi:util:slack'),
+    config = crowi.getConfig(),
     Config = crowi.model('Config'),
-    SlackWebClient = require('@slack/client').WebClient,
-    SlackIncomingWebhook = require('@slack/client').IncomingWebhook,
+    Slack = require('slack-node'),
     slack = {};
 
-  slack.client = undefined;
-  slack.incomingWebhook = undefined;
-
-  slack.getClient = function() {
-    // alreay created
-    if (slack.client) {
-      return slack.client;
-    }
-
-    const config = crowi.getConfig();
-
-    let client;
-    if (Config.hasSlackToken(config)) {
-      client = new SlackWebClient(config.notification['slack:token']);
-      slack.client = client;
-    }
-
-    return slack.client;
-  };
-
-  // this is called to generate redirect_uri
-  slack.getSlackAuthCallbackUrl = function()
-  {
-    var config = crowi.getConfig();
-    // Web アクセスがきてないと app:url がセットされないので crowi.setupSlack 時にはできない
-    // cli, bot 系作るときに問題なりそう
-    return (config.crowi['app:url'] || '') + '/admin/notification/slackAuth';
+  const postWithIwh = function(messageObj, callback) {
+    const client = new Slack();
+    client.setWebhook(config.notification['slack:incomingWebhookUrl']);
+    client.webhook(messageObj, callback);
   }
 
-  // this is called to get the url for oauth screen
-  slack.getAuthorizeURL = function () {
-    const config = crowi.getConfig();
-    if (Config.hasSlackWebClientConfig(config)) {
-      const slackClientId = config.notification['slack:clientId'];
-      const redirectUri = slack.getSlackAuthCallbackUrl();
-
-      return `${SLACK_URL}/oauth/authorize?client_id=${slackClientId}&redirect_uri=${redirectUri}&scope=chat:write:bot`;
-    } else {
-
-      return '';
-    }
+  const postWithWebApi = function(messageObj, callback) {
+    const client = new Slack(config.notification['slack:token']);
+    client.api('chat.postMessage', messageObj, callback);
   }
 
-  // this is called to get access token with code (oauth process)
-  slack.getOauthAccessToken = function(code) {
-
-    const client = new SlackWebClient();
-
-    const config = crowi.getConfig();
-    const clientId = config.notification['slack:clientId'];
-    const clientSecret = config.notification['slack:clientSecret'];
-    const redirectUri = slack.getSlackAuthCallbackUrl();
-
-    return client.oauth.access(clientId, clientSecret, code, {redirect_uri: redirectUri});
-  }
-
-  slack.getIncomingWebhook = function() {
-    // alreay created
-    if (slack.incomingWebhook) {
-      return slack.incomingWebhook;
-    }
-
-    const config = crowi.getConfig();
-
-    let incomingWebhook;
-    if (Config.hasSlackIwhUrl(config)) {
-      incomingWebhook = new SlackIncomingWebhook(config.notification['slack:incomingWebhookUrl']);
-      slack.incomingWebhook = incomingWebhook;
-    }
-
-    return slack.incomingWebhook;
-  };
-
-  slack.post = function (channel, message, opts) {
-    const config = crowi.getConfig();
-
-    return new Promise(function(resolve, reject) {
-
-      // define callback function
-      const callback = function(err, res) {
-        if (err) {
-          debug('Post error', err, res);
-          debug('Sent data to slack is:', message);
-          return reject(err);
-        }
-        resolve(res);
-      };
-
-      // when incoming Webhooks is prioritized
-      if (Config.isIncomingWebhookPrioritized(config)) {
-        if (Config.hasSlackIwhUrl(config)) {
-          debug(`posting message with IncomingWebhook`);
-          slack.getIncomingWebhook().send(opts, callback);
-        }
-        else if (Config.hasSlackToken(config)) {
-          debug(`posting message with WebClient`);
-          slack.getClient().chat.postMessage(channel, message, opts, callback);
-        }
-      }
-      // else
-      else {
-        if (Config.hasSlackToken(config)) {
-          debug(`posting message with WebClient`);
-          slack.getClient().chat.postMessage(channel, message, opts, callback);
-        }
-        else if (Config.hasSlackIwhUrl(config)) {
-          debug(`posting message with IncomingWebhook`);
-          slack.getIncomingWebhook().send(opts, callback);
-        }
-      }
-
-      resolve();
-    });
-  };
-
-  slack.convertMarkdownToMrkdwn = function(body) {
-    var config = crowi.getConfig();
+  const convertMarkdownToMrkdwn = function(body) {
     var url = '';
     if (config.crowi && config.crowi['app:url']) {
       url = config.crowi['app:url'];
@@ -145,16 +40,16 @@ module.exports = function(crowi) {
     return body;
   };
 
-  slack.prepareAttachmentTextForCreate = function(page, user) {
+  const prepareAttachmentTextForCreate = function(page, user) {
     var body = page.revision.body;
     if (body.length > 2000) {
       body = body.substr(0, 2000) + '...';
     }
 
-    return this.convertMarkdownToMrkdwn(body);
+    return convertMarkdownToMrkdwn(body);
   };
 
-  slack.prepareAttachmentTextForUpdate = function(page, user, previousRevision) {
+  const prepareAttachmentTextForUpdate = function(page, user, previousRevision) {
     var diff = require('diff');
     var diffText = ''
 
@@ -179,15 +74,14 @@ module.exports = function(crowi) {
     return diffText;
   };
 
-  slack.prepareSlackMessage = function(page, user, channel, updateType, previousRevision) {
-    var config = crowi.getConfig();
+  const prepareSlackMessage = function(page, user, channel, updateType, previousRevision) {
     var url = config.crowi['app:url'] || '';
     var body = page.revision.body;
 
     if (updateType == 'create') {
-      body = this.prepareAttachmentTextForCreate(page, user);
+      body = prepareAttachmentTextForCreate(page, user);
     } else {
-      body = this.prepareAttachmentTextForUpdate(page, user, previousRevision);
+      body = prepareAttachmentTextForUpdate(page, user, previousRevision);
     }
 
     var attachment = {
@@ -207,16 +101,15 @@ module.exports = function(crowi) {
     var message = {
       channel: '#' + channel,
       username: Config.appTitle(config),
-      text: this.getSlackMessageText(page.path, user, updateType),
+      text: getSlackMessageText(page.path, user, updateType),
       attachments: [attachment],
     };
 
     return message;
   };
 
-  slack.getSlackMessageText = function(path, user, updateType) {
+  const getSlackMessageText = function(path, user, updateType) {
     let text;
-    const config = crowi.getConfig();
     const url = config.crowi['app:url'] || '';
 
     const pageUrl = `<${url}${path}|${path}>`;
@@ -229,5 +122,80 @@ module.exports = function(crowi) {
     return text;
   };
 
+  // this is called to generate redirect_uri
+  slack.getSlackAuthCallbackUrl = function()
+  {
+    // Web アクセスがきてないと app:url がセットされないので crowi.setupSlack 時にはできない
+    // cli, bot 系作るときに問題なりそう
+    return (config.crowi['app:url'] || '') + '/admin/notification/slackAuth';
+  }
+
+  // this is called to get the url for oauth screen
+  slack.getAuthorizeURL = function () {
+    if (Config.hasSlackWebClientConfig(config)) {
+      const slackClientId = config.notification['slack:clientId'];
+      const redirectUri = slack.getSlackAuthCallbackUrl();
+
+      return `${SLACK_URL}/oauth/authorize?client_id=${slackClientId}&redirect_uri=${redirectUri}&scope=chat:write:bot`;
+    } else {
+
+      return '';
+    }
+  }
+
+  // this is called to get access token with code (oauth process)
+  slack.getOauthAccessToken = function(code) {
+
+    const client = new SlackWebClient();
+
+    const clientId = config.notification['slack:clientId'];
+    const clientSecret = config.notification['slack:clientSecret'];
+    const redirectUri = slack.getSlackAuthCallbackUrl();
+
+    return client.oauth.access(clientId, clientSecret, code, {redirect_uri: redirectUri});
+  }
+
+  // slack.post = function (channel, message, opts) {
+  slack.post = (page, user, channel, updateType, previousRevision) => {
+    const messageObj = prepareSlackMessage(page, user, channel, updateType, previousRevision);
+
+    return new Promise((resolve, reject) => {
+      // define callback function for Promise
+      const callback = function(err, res) {
+        if (err) {
+          debug('Post error', err, res);
+          debug('Sent data to slack is:', messageObj);
+          return reject(err);
+        }
+        resolve(res);
+      };
+
+      // when incoming Webhooks is prioritized
+      if (Config.isIncomingWebhookPrioritized(config)) {
+        if (Config.hasSlackIwhUrl(config)) {
+          debug(`posting message with IncomingWebhook`);
+          postWithIwh(messageObj, callback);
+        }
+        else if (Config.hasSlackToken(config)) {
+          debug(`posting message with Web API`);
+          postWithWebApi(messageObj, callback);
+        }
+      }
+      // else
+      else {
+        if (Config.hasSlackToken(config)) {
+          debug(`posting message with Web API`);
+          postWithWebApi(messageObj, callback);
+        }
+        else if (Config.hasSlackIwhUrl(config)) {
+          debug(`posting message with IncomingWebhook`);
+          postWithIwh(messageObj, callback);
+        }
+      }
+
+      resolve();
+    });
+  };
+
   return slack;
 };

+ 1 - 1
package.json

@@ -47,7 +47,6 @@
     "webpack": "webpack"
   },
   "dependencies": {
-    "@slack/client": "^3.14.0",
     "assets-webpack-plugin": "~3.5.1",
     "async": "^2.3.0",
     "autoprefixer": "^8.2.0",
@@ -137,6 +136,7 @@
     "reveal.js": "^3.5.0",
     "rimraf": "^2.6.1",
     "sass-loader": "^6.0.3",
+    "slack-node": "^0.1.8",
     "socket.io": "^2.0.3",
     "socket.io-client": "^2.0.3",
     "style-loader": "^0.20.1",

+ 52 - 129
yarn.lock

@@ -2,23 +2,6 @@
 # yarn lockfile v1
 
 
-"@slack/client@^3.14.0":
-  version "3.15.0"
-  resolved "https://registry.yarnpkg.com/@slack/client/-/client-3.15.0.tgz#796ee2b1182cd37fadbaeb37752121b2028a1704"
-  dependencies:
-    async "^1.5.0"
-    bluebird "^3.3.3"
-    eventemitter3 "^1.1.1"
-    https-proxy-agent "^1.0.0"
-    inherits "^2.0.1"
-    lodash "^4.13.1"
-    pkginfo "^0.4.0"
-    request ">=2.0.0 <2.77.0"
-    retry "^0.9.0"
-    url-join "0.0.1"
-    winston "^2.1.1"
-    ws "^1.0.1"
-
 "@types/body-parser@*":
   version "1.16.8"
   resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.16.8.tgz#687ec34140624a3bec2b1a8ea9268478ae8f3be3"
@@ -128,13 +111,6 @@ after@0.8.2:
   version "0.8.2"
   resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
 
-agent-base@2:
-  version "2.1.1"
-  resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
-  dependencies:
-    extend "~3.0.0"
-    semver "~5.0.1"
-
 agentkeepalive@^2.2.0:
   version "2.2.0"
   resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-2.2.0.tgz#c5d1bd4b129008f1163f236f86e5faea2026e2ef"
@@ -370,7 +346,7 @@ async-limiter@~1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
 
-async@1.5.2, async@^1.5.0:
+async@1.5.2:
   version "1.5.2"
   resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
 
@@ -394,10 +370,6 @@ async@~0.2.6:
   version "0.2.10"
   resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
 
-async@~1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9"
-
 asynckit@^0.4.0:
   version "0.4.0"
   resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -1123,10 +1095,6 @@ bluebird@3.5.0:
   version "3.5.0"
   resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c"
 
-bluebird@^3.3.3:
-  version "3.5.1"
-  resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
-
 bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
   version "4.11.8"
   resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
@@ -1671,7 +1639,7 @@ colormin@^1.0.5:
     css-color-names "0.0.4"
     has "^1.0.1"
 
-colors@1.0.3, colors@1.0.x:
+colors@1.0.3:
   version "1.0.3"
   resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
 
@@ -2030,10 +1998,6 @@ currently-unhandled@^0.4.1:
   dependencies:
     array-find-index "^1.0.1"
 
-cycle@1.0.x:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
-
 d@1:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
@@ -2065,12 +2029,6 @@ debounce@^1.0.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.1.0.tgz#6a1a4ee2a9dc4b7c24bb012558dbcdb05b37f408"
 
-debug@2, debug@2.6.9, debug@^2.0.0, debug@^2.2.0, debug@^2.6.8, debug@~2.6.4, debug@~2.6.6, debug@~2.6.9:
-  version "2.6.9"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
-  dependencies:
-    ms "2.0.0"
-
 debug@2.6.4:
   version "2.6.4"
   resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0"
@@ -2083,6 +2041,12 @@ debug@2.6.8:
   dependencies:
     ms "2.0.0"
 
+debug@2.6.9, debug@^2.0.0, debug@^2.2.0, debug@^2.6.8, debug@~2.6.4, debug@~2.6.6, debug@~2.6.9:
+  version "2.6.9"
+  resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+  dependencies:
+    ms "2.0.0"
+
 debug@3.1.0, debug@^3.1.0:
   version "3.1.0"
   resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
@@ -2643,7 +2607,7 @@ event-stream@~3.3.0:
     stream-combiner "~0.0.4"
     through "~2.3.1"
 
-eventemitter3@1.x.x, eventemitter3@^1.1.1:
+eventemitter3@1.x.x:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
 
@@ -2753,7 +2717,7 @@ express@^4.15.2, express@^4.16.1:
     utils-merge "1.0.1"
     vary "~1.1.2"
 
-extend@3, extend@^3.0.1, extend@~3.0.0, extend@~3.0.1:
+extend@^3.0.0, extend@^3.0.1, extend@~3.0.0, extend@~3.0.1:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
 
@@ -2792,10 +2756,6 @@ extsprintf@^1.2.0:
   version "1.4.0"
   resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
 
-eyes@0.1.x:
-  version "0.1.8"
-  resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
-
 fast-deep-equal@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
@@ -3446,14 +3406,6 @@ https-browserify@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
 
-https-proxy-agent@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6"
-  dependencies:
-    agent-base "2"
-    debug "2"
-    extend "3"
-
 i18next-express-middleware@^1.1.1:
   version "1.1.1"
   resolved "https://registry.yarnpkg.com/i18next-express-middleware/-/i18next-express-middleware-1.1.1.tgz#9204f28c8800ac3bff87fbee01945367956f349c"
@@ -3801,7 +3753,7 @@ isomorphic-fetch@^2.1.1:
     node-fetch "^1.0.1"
     whatwg-fetch ">=0.10.0"
 
-isstream@0.1.x, isstream@~0.1.2:
+isstream@~0.1.2:
   version "0.1.2"
   resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
 
@@ -4310,11 +4262,11 @@ lodash@^3.10.1:
   version "3.10.1"
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
 
-lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@~4.17.4:
+lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@~4.17.4:
   version "4.17.4"
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
 
-lodash@^4.2.0, lodash@^4.3.0:
+lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0:
   version "4.17.5"
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
 
@@ -4913,10 +4865,6 @@ node-sass@^4.5.0:
     stdout-stream "^1.4.0"
     "true-case-path" "^1.0.2"
 
-node-uuid@~1.4.7:
-  version "1.4.8"
-  resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
-
 nodemailer-ses-transport@~1.5.0:
   version "1.5.1"
   resolved "https://registry.yarnpkg.com/nodemailer-ses-transport/-/nodemailer-ses-transport-1.5.1.tgz#dc0598c1bf53e8652e632e8f31692ce022d7dea9"
@@ -5139,10 +5087,6 @@ optionator@^0.8.2:
     type-check "~0.3.2"
     wordwrap "~1.0.0"
 
-options@>=0.0.5:
-  version "0.0.6"
-  resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f"
-
 os-browserify@^0.3.0:
   version "0.3.0"
   resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
@@ -5433,10 +5377,6 @@ pkg-dir@^2.0.0:
   dependencies:
     find-up "^2.1.0"
 
-pkginfo@^0.4.0:
-  version "0.4.1"
-  resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
-
 plantuml-encoder@^1.2.5:
   version "1.2.5"
   resolved "https://registry.yarnpkg.com/plantuml-encoder/-/plantuml-encoder-1.2.5.tgz#6b8e5b9e1a1dbd88b3fd9fb46f734eec7d44b548"
@@ -6287,30 +6227,32 @@ request@2.81.0:
     tunnel-agent "^0.6.0"
     uuid "^3.0.0"
 
-"request@>=2.0.0 <2.77.0":
-  version "2.76.0"
-  resolved "https://registry.yarnpkg.com/request/-/request-2.76.0.tgz#be44505afef70360a0436955106be3945d95560e"
+request@^2.74.0:
+  version "2.85.0"
+  resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa"
   dependencies:
-    aws-sign2 "~0.6.0"
-    aws4 "^1.2.1"
-    caseless "~0.11.0"
+    aws-sign2 "~0.7.0"
+    aws4 "^1.6.0"
+    caseless "~0.12.0"
     combined-stream "~1.0.5"
-    extend "~3.0.0"
+    extend "~3.0.1"
     forever-agent "~0.6.1"
-    form-data "~2.1.1"
-    har-validator "~2.0.6"
-    hawk "~3.1.3"
-    http-signature "~1.1.0"
+    form-data "~2.3.1"
+    har-validator "~5.0.3"
+    hawk "~6.0.2"
+    http-signature "~1.2.0"
     is-typedarray "~1.0.0"
     isstream "~0.1.2"
     json-stringify-safe "~5.0.1"
-    mime-types "~2.1.7"
-    node-uuid "~1.4.7"
-    oauth-sign "~0.8.1"
-    qs "~6.3.0"
-    stringstream "~0.0.4"
-    tough-cookie "~2.3.0"
-    tunnel-agent "~0.4.1"
+    mime-types "~2.1.17"
+    oauth-sign "~0.8.2"
+    performance-now "^2.1.0"
+    qs "~6.5.1"
+    safe-buffer "^5.1.1"
+    stringstream "~0.0.5"
+    tough-cookie "~2.3.3"
+    tunnel-agent "^0.6.0"
+    uuid "^3.1.0"
 
 request@~2.79.0:
   version "2.79.0"
@@ -6337,6 +6279,15 @@ request@~2.79.0:
     tunnel-agent "~0.4.1"
     uuid "^3.0.0"
 
+requestretry@^1.2.2:
+  version "1.13.0"
+  resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94"
+  dependencies:
+    extend "^3.0.0"
+    lodash "^4.15.0"
+    request "^2.74.0"
+    when "^3.7.7"
+
 require-directory@^2.1.1:
   version "2.1.1"
   resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@@ -6407,10 +6358,6 @@ retry-axios@^0.3.2:
   version "0.3.2"
   resolved "https://registry.yarnpkg.com/retry-axios/-/retry-axios-0.3.2.tgz#5757c80f585b4cc4c4986aa2ffd47a60c6d35e13"
 
-retry@^0.9.0:
-  version "0.9.0"
-  resolved "https://registry.yarnpkg.com/retry/-/retry-0.9.0.tgz#6f697e50a0e4ddc8c8f7fb547a9b60dead43678d"
-
 reveal.js@^3.5.0:
   version "3.6.0"
   resolved "https://registry.yarnpkg.com/reveal.js/-/reveal.js-3.6.0.tgz#ce0e64f30cbebd6e5ce885c2f384085c5e5821e8"
@@ -6542,10 +6489,6 @@ select@^1.1.2:
   version "5.4.1"
   resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
 
-semver@~5.0.1:
-  version "5.0.3"
-  resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a"
-
 semver@~5.3.0:
   version "5.3.0"
   resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
@@ -6703,6 +6646,12 @@ sinon@^4.0.0:
     supports-color "^4.4.0"
     type-detect "^4.0.5"
 
+slack-node@^0.1.8:
+  version "0.1.8"
+  resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.1.8.tgz#cda98de8681485b301dc6742ddc3897117fad349"
+  dependencies:
+    requestretry "^1.2.2"
+
 slash@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
@@ -6852,10 +6801,6 @@ sshpk@^1.7.0:
     jsbn "~0.1.0"
     tweetnacl "~0.14.0"
 
-stack-trace@0.0.x:
-  version "0.0.10"
-  resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
-
 "statuses@>= 1.3.1 < 2":
   version "1.4.0"
   resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
@@ -7286,10 +7231,6 @@ uid-safe@~2.1.5:
   dependencies:
     random-bytes "~1.0.0"
 
-ultron@1.0.x:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa"
-
 ultron@~1.1.0:
   version "1.1.1"
   resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c"
@@ -7326,10 +7267,6 @@ unpipe@1.0.0, unpipe@~1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
 
-url-join@0.0.1:
-  version "0.0.1"
-  resolved "https://registry.yarnpkg.com/url-join/-/url-join-0.0.1.tgz#1db48ad422d3402469a87f7d97bdebfe4fb1e3c8"
-
 url-join@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.0.tgz#4d3340e807d3773bda9991f8305acdcc2a665d2a"
@@ -7525,6 +7462,10 @@ whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.3:
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
 
+when@^3.7.7:
+  version "3.7.8"
+  resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
+
 whet.extend@~0.9.9:
   version "0.9.9"
   resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1"
@@ -7561,17 +7502,6 @@ window-size@^0.2.0:
   version "0.2.0"
   resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075"
 
-winston@^2.1.1:
-  version "2.4.0"
-  resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.0.tgz#808050b93d52661ed9fb6c26b3f0c826708b0aee"
-  dependencies:
-    async "~1.0.0"
-    colors "1.0.x"
-    cycle "1.0.x"
-    eyes "0.1.x"
-    isstream "0.1.x"
-    stack-trace "0.0.x"
-
 wordwrap@0.0.2:
   version "0.0.2"
   resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
@@ -7601,13 +7531,6 @@ write@^0.2.1:
   dependencies:
     mkdirp "^0.5.1"
 
-ws@^1.0.1:
-  version "1.1.5"
-  resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51"
-  dependencies:
-    options ">=0.0.5"
-    ultron "1.0.x"
-
 ws@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/ws/-/ws-4.0.0.tgz#bfe1da4c08eeb9780b986e0e4d10eccd7345999f"