diff --git a/CHANGELOG.md b/CHANGELOG.md index 514d5f85..bfe52302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.2.0](https://github.com/voxmedia/github-action-slack-notify-build/compare/v1.1.3...v1.2.0) (2020-11-20) + + +### Features + +* Add semantic release ([6d56e60](https://github.com/voxmedia/github-action-slack-notify-build/commit/6d56e60b7083b18466446dcf4b45f1b566235400)) + # v1.1.3 - 11/10/2020 - Bump version of @actions/core diff --git a/dist/index.js b/dist/index.js index a3d2bf8e..932673b0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -297,6 +297,73 @@ function wrappy (fn, cb) { } +/***/ }), + +/***/ 15: +/***/ (function(module) { + +"use strict"; + + +const isWin = process.platform === 'win32'; + +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} + +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } + + const originalEmit = cp.emit; + + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } + } + + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} + +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } + + return null; +} + +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + + return null; +} + +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, +}; + + /***/ }), /***/ 18: @@ -343,53 +410,6 @@ function authenticationPlugin(octokit, options) { } -/***/ }), - -/***/ 20: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const cp = __webpack_require__(129); -const parse = __webpack_require__(568); -const enoent = __webpack_require__(881); - -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); - - return spawned; -} - -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - - return result; -} - -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; - - /***/ }), /***/ 26: @@ -768,27 +788,6 @@ module.exports = { }; -/***/ }), - -/***/ 39: -/***/ (function(module) { - -"use strict"; - -module.exports = opts => { - opts = opts || {}; - - const env = opts.env || process.env; - const platform = opts.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; -}; - - /***/ }), /***/ 47: @@ -902,9 +901,93 @@ module.exports = function(dst, src) { if (typeof process === 'undefined' || process.type === 'renderer') { module.exports = __webpack_require__(235); } else { - module.exports = __webpack_require__(738); + module.exports = __webpack_require__(317); +} + + +/***/ }), + +/***/ 79: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + +const pump = __webpack_require__(453); +const bufferStream = __webpack_require__(625); + +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} + +function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + options = Object.assign({maxBuffer: Infinity}, options); + + const {maxBuffer} = options; + + let stream; + return new Promise((resolve, reject) => { + const rejectPromise = error => { + if (error) { // A null check + error.bufferedData = stream.getBufferedValue(); + } + reject(error); + }; + + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } + + resolve(); + }); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }).then(() => stream.getBufferedValue()); } +module.exports = getStream; +module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); +module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); +module.exports.MaxBufferError = MaxBufferError; + + +/***/ }), + +/***/ 82: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map /***/ }), @@ -937,6 +1020,42 @@ function serial(list, iterator, callback) } +/***/ }), + +/***/ 102: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +// For internal use, subject to change. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + /***/ }), /***/ 104: @@ -1024,7 +1143,7 @@ exports.WebClient = WebClient_1.WebClient; exports.WebClientEvent = WebClient_1.WebClientEvent; var logger_1 = __webpack_require__(847); exports.LogLevel = logger_1.LogLevel; -var errors_1 = __webpack_require__(625); +var errors_1 = __webpack_require__(749); exports.ErrorCode = errors_1.ErrorCode; var retry_policies_1 = __webpack_require__(264); exports.retryPolicies = retry_policies_1.default; @@ -2145,7 +2264,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(317); +exports.humanize = __webpack_require__(632); /** * Active `debug` instances. @@ -2391,69 +2510,11 @@ function withAuthorizationPrefix(authorization) { /***/ }), -/***/ 145: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const pump = __webpack_require__(453); -const bufferStream = __webpack_require__(966); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = Object.assign({maxBuffer: Infinity}, options); +/***/ 147: +/***/ (function(module) { - const {maxBuffer} = options; - - let stream; - return new Promise((resolve, reject) => { - const rejectPromise = error => { - if (error) { // A null check - error.bufferedData = stream.getBufferedValue(); - } - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }).then(() => stream.getBufferedValue()); -} - -module.exports = getStream; -module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); -module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); -module.exports.MaxBufferError = MaxBufferError; - - -/***/ }), - -/***/ 147: -/***/ (function(module) { - -// API -module.exports = state; +// API +module.exports = state; /** * Creates initial state object @@ -2958,7 +3019,7 @@ module.exports = authenticationPlugin; const beforeRequest = __webpack_require__(863); const requestError = __webpack_require__(293); -const validate = __webpack_require__(954); +const validate = __webpack_require__(489); function authenticationPlugin(octokit, options) { if (!options.auth) { @@ -5759,6 +5820,46 @@ function normalizePaginatedListResponse(octokit, url, response) { } +/***/ }), + +/***/ 306: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +const fs = __webpack_require__(747); +const shebangCommand = __webpack_require__(907); + +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + let buffer; + + if (Buffer.alloc) { + // Node.js v4.5+ / v5.10+ + buffer = Buffer.alloc(size); + } else { + // Old Node.js API + buffer = new Buffer(size); + buffer.fill(0); // zero-fill + } + + let fd; + + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } + + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} + +module.exports = readShebang; + + /***/ }), /***/ 309: @@ -5835,161 +5936,195 @@ module.exports = {"name":"@octokit/graphql","version":"2.1.3","publishConfig":{" /***/ }), /***/ 317: -/***/ (function(module) { +/***/ (function(module, exports, __webpack_require__) { /** - * Helpers. + * Module dependencies. */ -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; +var tty = __webpack_require__(867); +var util = __webpack_require__(669); /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] + * This is the Node.js implementation of `debug()`. * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public + * Expose `debug()` as the module. */ -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; +exports = module.exports = __webpack_require__(138); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private + * Colors. */ -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; +exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + +try { + var supportsColor = __webpack_require__(247); + if (supportsColor && supportsColor.level >= 2) { + exports.colors = [ + 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, + 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, + 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 214, 215, 220, 221 + ]; } +} catch (err) { + // swallow - we only care if `supports-color` is available; it doesn't have to be. } /** - * Short format for `ms`. + * Build up the default `inspectOpts` object from the environment variables. * - * @param {Number} ms - * @return {String} - * @api private + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd'; - } - if (ms >= h) { - return Math.round(ms / h) + 'h'; - } - if (ms >= m) { - return Math.round(ms / m) + 'm'; - } - if (ms >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private + * Is stdout a TTY? Colored output is enabled when `true`. */ -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms'; +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(process.stderr.fd); } /** - * Pluralization helper. + * Map %o to `util.inspect()`, all on a single line. */ -function plural(ms, n, name) { - if (ms < n) { - return; - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name; - } - return Math.ceil(ms / n) + ' ' + name + 's'; -} - +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); + var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } else { + return new Date().toISOString() + ' '; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); + /***/ }), @@ -6289,7 +6424,7 @@ var utils = __webpack_require__(35); var bind = __webpack_require__(727); var Axios = __webpack_require__(779); var mergeConfig = __webpack_require__(825); -var defaults = __webpack_require__(774); +var defaults = __webpack_require__(706); /** * Create an instance of Axios @@ -6902,46 +7037,6 @@ exports.endpoint = endpoint; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 389: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const fs = __webpack_require__(747); -const shebangCommand = __webpack_require__(866); - -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - let buffer; - - if (Buffer.alloc) { - // Node.js v4.5+ / v5.10+ - buffer = Buffer.alloc(size); - } else { - // Old Node.js API - buffer = new Buffer(size); - buffer.fill(0); // zero-fill - } - - let fd; - - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } - - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} - -module.exports = readShebang; - - /***/ }), /***/ 402: @@ -7132,6 +7227,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); /** * Commands * @@ -7185,28 +7281,14 @@ class Command { return cmdStr; } } -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; function escapeData(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -7973,6 +8055,12 @@ function convertBody(buffer, headers) { // html4 if (!res && str) { res = /&|;, *?])/g; - -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - return arg; -} - -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; - - // Algorithm below is based on https://qntm.org/cmd - - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - - // Quote the whole thing: - arg = `"${arg}"`; - - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); - } - - return arg; -} - -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; - - /***/ }), /***/ 463: @@ -9326,6 +9362,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(431); +const file_command_1 = __webpack_require__(102); +const utils_1 = __webpack_require__(82); const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); /** @@ -9352,9 +9390,17 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); + const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } } exports.exportVariable = exportVariable; /** @@ -9370,7 +9416,13 @@ exports.setSecret = setSecret; * @param inputPath */ function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; @@ -9582,57 +9634,40 @@ function authenticationBeforeRequest(state, options) { /***/ }), -/***/ 489: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 473: +/***/ (function(module) { "use strict"; +module.exports = /^#!.*/; -const path = __webpack_require__(622); -const which = __webpack_require__(814); -const pathKey = __webpack_require__(39)(); -function resolveCommandAttempt(parsed, withoutPathExt) { - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; +/***/ }), - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (hasCustomCwd) { - try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ - } - } +/***/ 489: +/***/ (function(module) { - let resolved; +module.exports = validateAuth; - try { - resolved = which.sync(parsed.command, { - path: (parsed.options.env || process.env)[pathKey], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - process.chdir(cwd); - } +function validateAuth(auth) { + if (typeof auth === "string") { + return; + } - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); - } + if (typeof auth === "function") { + return; + } - return resolved; -} + if (auth.username && auth.password) { + return; + } -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); -} + if (auth.clientId && auth.clientSecret) { + return; + } -module.exports = resolveCommand; + throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`); +} /***/ }), @@ -9821,7 +9856,7 @@ module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"appl var register = __webpack_require__(363) var addHook = __webpack_require__(510) -var removeHook = __webpack_require__(763) +var removeHook = __webpack_require__(866) // bind with array of arguments: https://stackoverflow.com/a/21792913 var bind = Function.bind @@ -9904,6 +9939,61 @@ function hasFirstPage (link) { } +/***/ }), + +/***/ 542: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +const path = __webpack_require__(622); +const which = __webpack_require__(814); +const pathKey = __webpack_require__(565)(); + +function resolveCommandAttempt(parsed, withoutPathExt) { + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (hasCustomCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ + } + } + + let resolved; + + try { + resolved = which.sync(parsed.command, { + path: (parsed.options.env || process.env)[pathKey], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + process.chdir(cwd); + } + + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } + + return resolved; +} + +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} + +module.exports = resolveCommand; + + /***/ }), /***/ 543: @@ -10646,6 +10736,27 @@ module.exports = function settle(resolve, reject, response) { }; +/***/ }), + +/***/ 565: +/***/ (function(module) { + +"use strict"; + +module.exports = opts => { + opts = opts || {}; + + const env = opts.env || process.env; + const platform = opts.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; +}; + + /***/ }), /***/ 566: @@ -10682,139 +10793,6 @@ function clean(key) } -/***/ }), - -/***/ 568: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const path = __webpack_require__(622); -const niceTry = __webpack_require__(948); -const resolveCommand = __webpack_require__(489); -const escape = __webpack_require__(462); -const readShebang = __webpack_require__(389); -const semver = __webpack_require__(280); - -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - -// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 -const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; - -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); - - const shebang = parsed.file && readShebang(parsed.file); - - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - - return resolveCommand(parsed); - } - - return parsed.file; -} - -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } - - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); - - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); - - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); - - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } - - return parsed; -} - -function parseShell(parsed) { - // If node supports the shell option, there's no need to mimic its behavior - if (supportsShellOption) { - return parsed; - } - - // Mimic node shell option - // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - if (isWin) { - parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } else { - if (typeof parsed.options.shell === 'string') { - parsed.command = parsed.options.shell; - } else if (process.platform === 'android') { - parsed.command = '/system/bin/sh'; - } else { - parsed.command = '/bin/sh'; - } - - parsed.args = ['-c', shellCommand]; - } - - return parsed; -} - -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original - - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; - - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); -} - -module.exports = parse; - - /***/ }), /***/ 577: @@ -11190,7 +11168,7 @@ exports.getUserAgent = getUserAgent; "use strict"; const path = __webpack_require__(622); -const pathKey = __webpack_require__(39); +const pathKey = __webpack_require__(682); module.exports = opts => { opts = Object.assign({ @@ -11239,74 +11217,61 @@ module.exports = require("path"); /***/ }), /***/ 625: -/***/ (function(__unusedmodule, exports) { +/***/ (function(module, __unusedexports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * A dictionary of codes for errors produced by this package - */ -var ErrorCode; -(function (ErrorCode) { - ErrorCode["RequestError"] = "slack_webapi_request_error"; - ErrorCode["HTTPError"] = "slack_webapi_http_error"; - ErrorCode["PlatformError"] = "slack_webapi_platform_error"; - ErrorCode["RateLimitedError"] = "slack_webapi_rate_limited_error"; -})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {})); -/** - * Factory for producing a {@link CodedError} from a generic error - */ -function errorWithCode(error, code) { - // NOTE: might be able to return something more specific than a CodedError with conditional typing - const codedError = error; - codedError.code = code; - return codedError; -} -/** - * A factory to create WebAPIRequestError objects - * @param original - original error - */ -function requestErrorWithOriginal(original) { - const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError); - error.original = original; - return error; -} -exports.requestErrorWithOriginal = requestErrorWithOriginal; -/** - * A factory to create WebAPIHTTPError objects - * @param response - original error - */ -function httpErrorFromResponse(response) { - const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${response.status}`), ErrorCode.HTTPError); - error.statusCode = response.status; - error.statusMessage = response.statusText; - error.headers = response.headers; - error.body = response.data; - return error; -} -exports.httpErrorFromResponse = httpErrorFromResponse; -/** - * A factory to create WebAPIPlatformError objects - * @param result - Web API call result - */ -function platformErrorFromResult(result) { - const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError); - error.data = result; - return error; -} -exports.platformErrorFromResult = platformErrorFromResult; -/** - * A factory to create WebAPIRateLimitedError objects - * @param retrySec - Number of seconds that the request can be retried in - */ -function rateLimitedErrorWithDelay(retrySec) { - const error = errorWithCode(new Error(`A rate-limit has been reached, you may retry this request in ${retrySec} seconds`), ErrorCode.RateLimitedError); - error.retryAfter = retrySec; - return error; -} -exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay; -//# sourceMappingURL=errors.js.map +const {PassThrough} = __webpack_require__(413); + +module.exports = options => { + options = Object.assign({}, options); + + const {array} = options; + let {encoding} = options; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; + /***/ }), @@ -11425,6 +11390,165 @@ module.exports = function parseHeaders(headers) { }; +/***/ }), + +/***/ 632: +/***/ (function(module) { + +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} + + /***/ }), /***/ 649: @@ -11886,19 +12010,40 @@ module.exports = function btoa(str) { /***/ }), -/***/ 688: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 682: +/***/ (function(module) { "use strict"; +module.exports = opts => { + opts = opts || {}; -var utils = __webpack_require__(35); + const env = opts.env || process.env; + const platform = opts.platform || process.platform; -module.exports = ( - utils.isStandardBrowserEnv() ? + if (platform !== 'win32') { + return 'PATH'; + } - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. + return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; +}; + + +/***/ }), + +/***/ 688: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(35); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. (function standardBrowserEnv() { var msie = /(msie|trident)/i.test(navigator.userAgent); var urlParsingNode = document.createElement('a'); @@ -12059,325 +12204,139 @@ module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"own /***/ }), -/***/ 727: -/***/ (function(module) { +/***/ 706: +/***/ (function(module, __unusedexports, __webpack_require__) { "use strict"; -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; +var utils = __webpack_require__(35); +var normalizeHeaderName = __webpack_require__(411); +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; -/***/ }), +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} -/***/ 728: -/***/ (function(__unusedmodule, exports) { +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(219); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(670); + } + return adapter; +} -"use strict"; +var defaults = { + adapter: getDefaultAdapter(), -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Severity levels for log entries - */ -var LogLevel; -(function (LogLevel) { - LogLevel["ERROR"] = "error"; - LogLevel["WARN"] = "warn"; - LogLevel["INFO"] = "info"; - LogLevel["DEBUG"] = "debug"; -})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); -/** - * Default logger which logs to stdout and stderr - */ -class ConsoleLogger { - constructor() { - this.level = LogLevel.INFO; - this.name = ''; - } - getLevel() { - return this.level; - } - /** - * Sets the instance's log level so that only messages which are equal or more severe are output to the console. - */ - setLevel(level) { - this.level = level; - } - /** - * Set the instance's name, which will appear on each log line before the message. - */ - setName(name) { - this.name = name; - } - /** - * Log a debug message - */ - debug(...msg) { - if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) { - console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg); - } - } - /** - * Log an info message - */ - info(...msg) { - if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) { - console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg); - } + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; } - /** - * Log a warning message - */ - warn(...msg) { - if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) { - console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg); - } + if (utils.isArrayBufferView(data)) { + return data.buffer; } - /** - * Log an error message - */ - error(...msg) { - if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) { - console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg); - } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); } - /** - * Helper to compare two log levels and determine if a is equal or more severe than b - */ - static isMoreOrEqualSevere(a, b) { - return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b]; + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); } -} -/** Map of labels for each log level */ -ConsoleLogger.labels = (() => { - const entries = Object.entries(LogLevel); - const map = entries.map(([key, value]) => { - return [value, `[${key}] `]; - }); - return new Map(map); -})(); -/** Map of severity as comparable numbers for each log level */ -ConsoleLogger.severity = { - [LogLevel.ERROR]: 400, - [LogLevel.WARN]: 300, - [LogLevel.INFO]: 200, - [LogLevel.DEBUG]: 100, -}; -exports.ConsoleLogger = ConsoleLogger; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 732: -/***/ (function(module) { - -"use strict"; - - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; - - -/***/ }), - -/***/ 738: -/***/ (function(module, exports, __webpack_require__) { - -/** - * Module dependencies. - */ - -var tty = __webpack_require__(867); -var util = __webpack_require__(669); + return data; + }], -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], -exports = module.exports = __webpack_require__(138); -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, -/** - * Colors. - */ + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', -exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + maxContentLength: -1, -try { - var supportsColor = __webpack_require__(247); - if (supportsColor && supportsColor.level >= 2) { - exports.colors = [ - 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, - 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, - 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 214, 215, 220, 221 - ]; + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; } -} catch (err) { - // swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(function (key) { - return /^debug_/i.test(key); -}).reduce(function (obj, key) { - // camel-case - var prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); - - // coerce string value into JS value - var val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) val = true; - else if (/^(no|off|false|disabled)$/i.test(val)) val = false; - else if (val === 'null') val = null; - else val = Number(val); - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts - ? Boolean(exports.inspectOpts.colors) - : tty.isatty(process.stderr.fd); -} - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -exports.formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n').map(function(str) { - return str.trim() - }).join(' '); }; -/** - * Map %o to `util.inspect()`, allowing multiple lines if needed. - */ - -exports.formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } }; -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - var name = this.namespace; - var useColors = this.useColors; - - if (useColors) { - var c = this.color; - var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); - var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } else { - return new Date().toISOString() + ' '; - } -} +module.exports = defaults; -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ -function log() { - return process.stderr.write(util.format.apply(util, arguments) + '\n'); -} +/***/ }), -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ +/***/ 727: +/***/ (function(module) { -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} +"use strict"; -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - return process.env.DEBUG; -} +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ -function init (debug) { - debug.inspectOpts = {}; +/***/ }), - var keys = Object.keys(exports.inspectOpts); - for (var i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} +/***/ 732: +/***/ (function(module) { -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ +"use strict"; -exports.enable(load()); + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; /***/ }), @@ -12453,6 +12412,78 @@ module.exports = require("fs"); /***/ }), +/***/ 749: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A dictionary of codes for errors produced by this package + */ +var ErrorCode; +(function (ErrorCode) { + ErrorCode["RequestError"] = "slack_webapi_request_error"; + ErrorCode["HTTPError"] = "slack_webapi_http_error"; + ErrorCode["PlatformError"] = "slack_webapi_platform_error"; + ErrorCode["RateLimitedError"] = "slack_webapi_rate_limited_error"; +})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {})); +/** + * Factory for producing a {@link CodedError} from a generic error + */ +function errorWithCode(error, code) { + // NOTE: might be able to return something more specific than a CodedError with conditional typing + const codedError = error; + codedError.code = code; + return codedError; +} +/** + * A factory to create WebAPIRequestError objects + * @param original - original error + */ +function requestErrorWithOriginal(original) { + const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError); + error.original = original; + return error; +} +exports.requestErrorWithOriginal = requestErrorWithOriginal; +/** + * A factory to create WebAPIHTTPError objects + * @param response - original error + */ +function httpErrorFromResponse(response) { + const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${response.status}`), ErrorCode.HTTPError); + error.statusCode = response.status; + error.statusMessage = response.statusText; + error.headers = response.headers; + error.body = response.data; + return error; +} +exports.httpErrorFromResponse = httpErrorFromResponse; +/** + * A factory to create WebAPIPlatformError objects + * @param result - Web API call result + */ +function platformErrorFromResult(result) { + const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError); + error.data = result; + return error; +} +exports.platformErrorFromResult = platformErrorFromResult; +/** + * A factory to create WebAPIRateLimitedError objects + * @param retrySec - Number of seconds that the request can be retried in + */ +function rateLimitedErrorWithDelay(retrySec) { + const error = errorWithCode(new Error(`A rate-limit has been reached, you may retry this request in ${retrySec} seconds`), ErrorCode.RateLimitedError); + error.retryAfter = retrySec; + return error; +} +exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay; +//# sourceMappingURL=errors.js.map + +/***/ }), + /***/ 751: /***/ (function(module, __unusedexports, __webpack_require__) { @@ -12650,34 +12681,63 @@ exports.request = request; /***/ }), -/***/ 761: +/***/ 759: /***/ (function(module) { -module.exports = require("zlib"); +"use strict"; -/***/ }), -/***/ 763: -/***/ (function(module) { +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; -module.exports = removeHook +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); -function removeHook (state, name, method) { - if (!state.registry[name]) { - return - } + return arg; +} - var index = state.registry[name] - .map(function (registered) { return registered.orig }) - .indexOf(method) +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; - if (index === -1) { - return - } + // Algorithm below is based on https://qntm.org/cmd - state.registry[name].splice(index, 1) + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); + + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); + + // All other backslashes occur literally + + // Quote the whole thing: + arg = `"${arg}"`; + + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } + + return arg; } +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; + + +/***/ }), + +/***/ 761: +/***/ (function(module) { + +module.exports = require("zlib"); /***/ }), @@ -12710,101 +12770,43 @@ module.exports = function (x) { "use strict"; -var utils = __webpack_require__(35); -var normalizeHeaderName = __webpack_require__(411); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(219); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __webpack_require__(670); - } - return adapter; -} - -var defaults = { - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data)) { - setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); - return JSON.stringify(data); - } - return data; - }], +const cp = __webpack_require__(129); +const parse = __webpack_require__(884); +const enoent = __webpack_require__(15); - transformResponse: [function transformResponse(data) { - /*eslint no-param-reassign:0*/ - if (typeof data === 'string') { - try { - data = JSON.parse(data); - } catch (e) { /* Ignore */ } - } - return data; - }], +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); - maxContentLength: -1, + return spawned; +} - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); + return result; +} -module.exports = defaults; +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; + +module.exports._parse = parse; +module.exports._enoent = enoent; /***/ }), @@ -13145,12 +13147,100 @@ function whichSync (cmd, opt) { /***/ }), /***/ 816: -/***/ (function(module) { +/***/ (function(__unusedmodule, exports) { "use strict"; -module.exports = /^#!.*/; - +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Severity levels for log entries + */ +var LogLevel; +(function (LogLevel) { + LogLevel["ERROR"] = "error"; + LogLevel["WARN"] = "warn"; + LogLevel["INFO"] = "info"; + LogLevel["DEBUG"] = "debug"; +})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); +/** + * Default logger which logs to stdout and stderr + */ +class ConsoleLogger { + constructor() { + this.level = LogLevel.INFO; + this.name = ''; + } + getLevel() { + return this.level; + } + /** + * Sets the instance's log level so that only messages which are equal or more severe are output to the console. + */ + setLevel(level) { + this.level = level; + } + /** + * Set the instance's name, which will appear on each log line before the message. + */ + setName(name) { + this.name = name; + } + /** + * Log a debug message + */ + debug(...msg) { + if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) { + console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg); + } + } + /** + * Log an info message + */ + info(...msg) { + if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) { + console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg); + } + } + /** + * Log a warning message + */ + warn(...msg) { + if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) { + console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg); + } + } + /** + * Log an error message + */ + error(...msg) { + if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) { + console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg); + } + } + /** + * Helper to compare two log levels and determine if a is equal or more severe than b + */ + static isMoreOrEqualSevere(a, b) { + return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b]; + } +} +/** Map of labels for each log level */ +ConsoleLogger.labels = (() => { + const entries = Object.entries(LogLevel); + const map = entries.map(([key, value]) => { + return [value, `[${key}] `]; + }); + return new Map(map); +})(); +/** Map of severity as comparable numbers for each log level */ +ConsoleLogger.severity = { + [LogLevel.ERROR]: 400, + [LogLevel.WARN]: 300, + [LogLevel.INFO]: 200, + [LogLevel.DEBUG]: 100, +}; +exports.ConsoleLogger = ConsoleLogger; +//# sourceMappingURL=index.js.map /***/ }), @@ -13668,8 +13758,8 @@ if (true) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const logger_1 = __webpack_require__(728); -var logger_2 = __webpack_require__(728); +const logger_1 = __webpack_require__(816); +var logger_2 = __webpack_require__(816); exports.LogLevel = logger_2.LogLevel; let instanceCount = 0; /** @@ -14845,28 +14935,25 @@ module.exports = ( /***/ }), /***/ 866: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; +/***/ (function(module) { -var shebangRegex = __webpack_require__(816); +module.exports = removeHook -module.exports = function (str) { - var match = str.match(shebangRegex); +function removeHook (state, name, method) { + if (!state.registry[name]) { + return + } - if (!match) { - return null; - } + var index = state.registry[name] + .map(function (registered) { return registered.orig }) + .indexOf(method) - var arr = match[0].replace(/#! ?/, '').split(' '); - var bin = arr[0].split('/').pop(); - var arg = arr[1]; + if (index === -1) { + return + } - return (bin === 'env' ? - arg : - bin + (arg ? ' ' + arg : '') - ); -}; + state.registry[name].splice(index, 1) +} /***/ }), @@ -14891,90 +14978,23 @@ module.exports = require("tty"); * * ```js * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; - - -/***/ }), - -/***/ 881: -/***/ (function(module) { - -"use strict"; - - -const isWin = process.platform === 'win32'; - -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); -} - -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } - - const originalEmit = cp.emit; - - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); - - if (err) { - return originalEmit.call(cp, 'error', err); - } - } - - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; -} - -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } - - return null; -} - -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - - return null; -} - -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; }; @@ -15975,6 +15995,139 @@ function set(object, path, value) { module.exports = set; +/***/ }), + +/***/ 884: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +const path = __webpack_require__(622); +const niceTry = __webpack_require__(948); +const resolveCommand = __webpack_require__(542); +const escape = __webpack_require__(759); +const readShebang = __webpack_require__(306); +const semver = __webpack_require__(280); + +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; + +// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 +const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; + +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); + + const shebang = parsed.file && readShebang(parsed.file); + + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + + return resolveCommand(parsed); + } + + return parsed.file; +} + +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } + + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); + + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); + + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); + + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); + + const shellCommand = [parsed.command].concat(parsed.args).join(' '); + + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } + + return parsed; +} + +function parseShell(parsed) { + // If node supports the shell option, there's no need to mimic its behavior + if (supportsShellOption) { + return parsed; + } + + // Mimic node shell option + // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 + const shellCommand = [parsed.command].concat(parsed.args).join(' '); + + if (isWin) { + parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } else { + if (typeof parsed.options.shell === 'string') { + parsed.command = parsed.options.shell; + } else if (process.platform === 'android') { + parsed.command = '/system/bin/sh'; + } else { + parsed.command = '/bin/sh'; + } + + parsed.args = ['-c', shellCommand]; + } + + return parsed; +} + +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original + + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; + + // Delegate further parsing to shell or non-shell + return options.shell ? parseShell(parsed) : parseNonShell(parsed); +} + +module.exports = parse; + + /***/ }), /***/ 887: @@ -16184,6 +16337,33 @@ function patchForDeprecation(octokit, apiOptions, method, methodName) { } +/***/ }), + +/***/ 907: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + +var shebangRegex = __webpack_require__(473); + +module.exports = function (str) { + var match = str.match(shebangRegex); + + if (!match) { + return null; + } + + var arr = match[0].replace(/#! ?/, '').split(' '); + var bin = arr[0].split('/').pop(); + var arg = arr[1]; + + return (bin === 'env' ? + arg : + bin + (arg ? ' ' + arg : '') + ); +}; + + /***/ }), /***/ 928: @@ -16737,7 +16917,7 @@ function terminator(callback) var utils = __webpack_require__(35); var transformData = __webpack_require__(589); var isCancel = __webpack_require__(732); -var defaults = __webpack_require__(774); +var defaults = __webpack_require__(706); /** * Throws a `Cancel` if cancellation has been requested. @@ -16832,34 +17012,6 @@ module.exports = function(fn) { } -/***/ }), - -/***/ 954: -/***/ (function(module) { - -module.exports = validateAuth; - -function validateAuth(auth) { - if (typeof auth === "string") { - return; - } - - if (typeof auth === "function") { - return; - } - - if (auth.username && auth.password) { - return; - } - - if (auth.clientId && auth.clientSecret) { - return; - } - - throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`); -} - - /***/ }), /***/ 955: @@ -16869,11 +17021,11 @@ function validateAuth(auth) { const path = __webpack_require__(622); const childProcess = __webpack_require__(129); -const crossSpawn = __webpack_require__(20); +const crossSpawn = __webpack_require__(774); const stripEof = __webpack_require__(768); const npmRunPath = __webpack_require__(621); const isStream = __webpack_require__(323); -const _getStream = __webpack_require__(145); +const _getStream = __webpack_require__(79); const pFinally = __webpack_require__(697); const onExit = __webpack_require__(260); const errname = __webpack_require__(427); @@ -17310,7 +17462,7 @@ const axios_1 = __importDefault(__webpack_require__(53)); const form_data_1 = __importDefault(__webpack_require__(928)); // tslint:disable-line:import-name const methods = __importStar(__webpack_require__(701)); // tslint:disable-line:import-name const instrument_1 = __webpack_require__(616); -const errors_1 = __webpack_require__(625); +const errors_1 = __webpack_require__(749); const logger_1 = __webpack_require__(847); const retry_policies_1 = __importDefault(__webpack_require__(264)); const helpers_1 = __webpack_require__(501); @@ -18059,65 +18211,6 @@ function warnDeprecations(method, logger) { } //# sourceMappingURL=WebClient.js.map -/***/ }), - -/***/ 966: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const {PassThrough} = __webpack_require__(413); - -module.exports = options => { - options = Object.assign({}, options); - - const {array} = options; - let {encoding} = options; - const buffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } - - if (buffer) { - encoding = null; - } - - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - stream.on('data', chunk => { - ret.push(chunk); - - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return ret; - } - - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; - - stream.getBufferedLength = () => len; - - return stream; -}; - - /***/ }), /***/ 969: diff --git a/package.json b/package.json index 33d65a07..dfb23097 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-action-slack-notify-build", - "version": "1.0.0", + "version": "1.2.0", "main": "index.js", "license": "Apache-2.0", "scripts": {