From ad9cf8de57326c6a46ae47a955784aaabdb563af Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 20 Jul 2020 15:28:38 +0900 Subject: [PATCH 01/33] Convert to typescript --- .eslintignore | 3 + .eslintrc.json | 34 +- .github/workflows/ci.yml | 4 +- .gitignore | 3 +- .prettierignore | 3 + .prettierrc.json | 11 + __test__/command-helper.test.ts | 231 + action.yml | 7 + dist/index.js | 30613 ++++++++---------------------- jest.config.js | 14 +- package-lock.json | 4732 ++--- package.json | 38 +- src/command-helper.ts | 246 + src/func.js | 204 - src/func.test.js | 202 - src/{index.js => main.ts} | 172 +- src/octokit-client.ts | 7 + tsconfig.json | 16 + 18 files changed, 10674 insertions(+), 25866 deletions(-) create mode 100644 .eslintignore create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 __test__/command-helper.test.ts create mode 100644 src/command-helper.ts delete mode 100644 src/func.js delete mode 100644 src/func.test.js rename src/{index.js => main.ts} (52%) create mode 100644 src/octokit-client.ts create mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..6de9a7611 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +dist/ +lib/ +node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json index d097bf7db..799df884c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,17 +1,19 @@ { - "env": { - "commonjs": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parserOptions": { - "ecmaVersion": 2018 - }, - "rules": { - } -} \ No newline at end of file + "env": { "node": true, "jest": true }, + "parser": "@typescript-eslint/parser", + "parserOptions": { "ecmaVersion": 9, "sourceType": "module" }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/errors", + "plugin:import/warnings", + "plugin:import/typescript", + "plugin:prettier/recommended", + "prettier/@typescript-eslint" + ], + "plugins": ["@typescript-eslint"], + "rules": { + "@typescript-eslint/camelcase": "off" + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6c9e6eff..8977acc4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,10 @@ jobs: with: node-version: 12.x - run: npm ci + - run: npm run build + - run: npm run format-check + - run: npm run lint - run: npm run test - - run: npm run package - uses: actions/upload-artifact@v2 with: name: dist diff --git a/.gitignore b/.gitignore index 3c3629e64..3b4e8dcf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules +lib/ +node_modules/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..6de9a7611 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +dist/ +lib/ +node_modules/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..386485a76 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,11 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": false, + "arrowParens": "avoid", + "parser": "typescript" +} \ No newline at end of file diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts new file mode 100644 index 000000000..5fc0c840d --- /dev/null +++ b/__test__/command-helper.test.ts @@ -0,0 +1,231 @@ +import { + Inputs, + Command, + SlashCommandPayload, + commandDefaults, + getCommandsConfigFromInputs, + getCommandsConfigFromJson, + actorHasPermission, + configIsValid, + getSlashCommandPayload +} from '../lib/command-helper' + +describe('command-helper tests', () => { + test('building config with required inputs only', async () => { + const inputs: Inputs = { + token: '', + reactionToken: '', + reactions: true, + commands: 'list, of, slash, commands', + permission: 'write', + issueType: 'both', + allowEdits: false, + // Should be process.env.GITHUB_REPOSITORY, but '' for tests + repository: '', + eventTypeSuffix: '-command', + namedArgs: false, + config: '', + configFromFile: '' + } + const commands = inputs.commands.replace(/\s+/g, '').split(',') + const config = getCommandsConfigFromInputs(inputs) + expect(config.length).toEqual(4) + for (var i = 0; i < config.length; i++) { + expect(config[i].command).toEqual(commands[i]) + expect(config[i].permission).toEqual(commandDefaults.permission) + expect(config[i].issue_type).toEqual(commandDefaults.issue_type) + expect(config[i].allow_edits).toEqual(commandDefaults.allow_edits) + expect(config[i].repository).toEqual(commandDefaults.repository) + expect(config[i].event_type_suffix).toEqual( + commandDefaults.event_type_suffix + ) + expect(config[i].named_args).toEqual(commandDefaults.named_args) + } + }) + + test('building config with optional inputs', async () => { + const inputs: Inputs = { + token: '', + reactionToken: '', + reactions: true, + commands: 'list, of, slash, commands', + permission: 'admin', + issueType: 'pull-request', + allowEdits: true, + repository: 'owner/repo', + eventTypeSuffix: '-cmd', + namedArgs: true, + config: '', + configFromFile: '' + } + const commands = inputs.commands.replace(/\s+/g, '').split(',') + const config = getCommandsConfigFromInputs(inputs) + expect(config.length).toEqual(4) + for (var i = 0; i < config.length; i++) { + expect(config[i].command).toEqual(commands[i]) + expect(config[i].permission).toEqual(inputs.permission) + expect(config[i].issue_type).toEqual(inputs.issueType) + expect(config[i].allow_edits).toEqual(inputs.allowEdits) + expect(config[i].repository).toEqual(inputs.repository) + expect(config[i].event_type_suffix).toEqual(inputs.eventTypeSuffix) + expect(config[i].named_args).toEqual(inputs.namedArgs) + } + }) + + test('building config with required JSON only', async () => { + const json = `[ + { + "command": "do-stuff" + }, + { + "command": "test-all-the-things" + } + ]` + const commands = ['do-stuff', 'test-all-the-things'] + const config = getCommandsConfigFromJson(json) + expect(config.length).toEqual(2) + for (var i = 0; i < config.length; i++) { + expect(config[i].command).toEqual(commands[i]) + expect(config[i].permission).toEqual(commandDefaults.permission) + expect(config[i].issue_type).toEqual(commandDefaults.issue_type) + expect(config[i].allow_edits).toEqual(commandDefaults.allow_edits) + expect(config[i].repository).toEqual(commandDefaults.repository) + expect(config[i].event_type_suffix).toEqual( + commandDefaults.event_type_suffix + ) + expect(config[i].named_args).toEqual(commandDefaults.named_args) + } + }) + + test('building config with optional JSON properties', async () => { + const json = `[ + { + "command": "do-stuff", + "permission": "admin", + "issue_type": "pull-request", + "allow_edits": true, + "repository": "owner/repo", + "event_type_suffix": "-cmd", + "named_args": true + }, + { + "command": "test-all-the-things", + "permission": "read" + } + ]` + const commands = ['do-stuff', 'test-all-the-things'] + const config = getCommandsConfigFromJson(json) + expect(config.length).toEqual(2) + expect(config[0].command).toEqual(commands[0]) + expect(config[0].permission).toEqual('admin') + expect(config[0].issue_type).toEqual('pull-request') + expect(config[0].allow_edits).toBeTruthy() + expect(config[0].repository).toEqual('owner/repo') + expect(config[0].event_type_suffix).toEqual('-cmd') + expect(config[0].named_args).toBeTruthy() + expect(config[1].command).toEqual(commands[1]) + expect(config[1].permission).toEqual('read') + expect(config[1].issue_type).toEqual(commandDefaults.issue_type) + }) + + test('valid config', async () => { + const config: Command[] = [ + { + command: 'test', + permission: 'write', + issue_type: 'both', + allow_edits: false, + repository: 'peter-evans/slash-command-dispatch', + event_type_suffix: '-command', + named_args: false + } + ] + expect(configIsValid(config)).toBeTruthy() + }) + + test('invalid permission level in config', async () => { + const config: Command[] = [ + { + command: 'test', + permission: 'test-case-invalid-permission', + issue_type: 'both', + allow_edits: false, + repository: 'peter-evans/slash-command-dispatch', + event_type_suffix: '-command', + named_args: false + } + ] + expect(configIsValid(config)).toBeFalsy() + }) + + test('invalid issue type in config', async () => { + const config: Command[] = [ + { + command: 'test', + permission: 'write', + issue_type: 'test-case-invalid-issue-type', + allow_edits: false, + repository: 'peter-evans/slash-command-dispatch', + event_type_suffix: '-command', + named_args: false + } + ] + expect(configIsValid(config)).toBeFalsy() + }) + + test('actor does not have permission', async () => { + expect(actorHasPermission('none', 'read')).toBeFalsy() + expect(actorHasPermission('read', 'write')).toBeFalsy() + expect(actorHasPermission('write', 'admin')).toBeFalsy() + }) + + test('actor has permission', async () => { + expect(actorHasPermission('read', 'none')).toBeTruthy() + expect(actorHasPermission('write', 'read')).toBeTruthy() + expect(actorHasPermission('admin', 'write')).toBeTruthy() + expect(actorHasPermission('write', 'write')).toBeTruthy() + }) + + test('slash command payload', async () => { + const commandWords = ['test', 'arg1', 'arg2', 'arg3'] + const namedArgs = false + const payload: SlashCommandPayload = { + command: 'test', + args: 'arg1 arg2 arg3', + arg1: 'arg1', + arg2: 'arg2', + arg3: 'arg3' + } + expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + }) + + test('slash command payload with named args', async () => { + const commandWords = ['test', 'branch=master', 'arg1', 'env=prod', 'arg2'] + const namedArgs = true + const payload: SlashCommandPayload = { + command: 'test', + args: 'branch=master arg1 env=prod arg2', + unnamed_args: 'arg1 arg2', + branch: 'master', + env: 'prod', + arg1: 'arg1', + arg2: 'arg2' + } + expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + }) + + test('slash command payload with malformed named args', async () => { + const commandWords = ['test', 'branch=', 'arg1', 'e-nv=prod', 'arg2'] + const namedArgs = true + const payload: SlashCommandPayload = { + command: 'test', + args: 'branch= arg1 e-nv=prod arg2', + unnamed_args: 'branch= arg1 e-nv=prod arg2', + arg1: 'branch=', + arg2: 'arg1', + arg3: 'e-nv=prod', + arg4: 'arg2' + } + expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + }) +}) diff --git a/action.yml b/action.yml index 5cec50d55..9d741e3fe 100644 --- a/action.yml +++ b/action.yml @@ -9,21 +9,28 @@ inputs: default: ${{ github.token }} reactions: description: 'Add reactions to comments containing commands.' + default: true commands: description: 'A comma separated list of commands.' required: true permission: description: 'The repository permission level required by the user to dispatch commands.' + default: write issue-type: description: 'The issue type required for commands.' + default: both allow-edits: description: 'Allow edited comments to trigger command dispatches.' + default: false repository: description: 'The full name of the repository to send the dispatch events.' + default: ${{ github.repository }} event-type-suffix: description: 'The repository dispatch event type suffix for the commands.' + default: -command named-args: description: 'Parse named arguments and add them to the command payload.' + default: false config: description: 'JSON configuration for commands.' config-from-file: diff --git a/dist/index.js b/dist/index.js index d73b4479f..e55fb095f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; @@ -34,7 +40,7 @@ module.exports = /******/ // the startup function /******/ function startup() { /******/ // Load entry module and return exports -/******/ return __webpack_require__(676); +/******/ return __webpack_require__(198); /******/ }; /******/ /******/ // run startup @@ -43,56 +49,6 @@ module.exports = /************************************************************************/ /******/ ({ -/***/ 0: -/***/ (function(module, __unusedexports, __webpack_require__) { - -const { requestLog } = __webpack_require__(916); -const { - restEndpointMethods -} = __webpack_require__(842); - -const Core = __webpack_require__(529); - -const CORE_PLUGINS = [ - __webpack_require__(190), - __webpack_require__(19), // deprecated: remove in v17 - requestLog, - __webpack_require__(148), - restEndpointMethods, - __webpack_require__(430), - - __webpack_require__(850) // deprecated: remove in v17 -]; - -const OctokitRest = Core.plugin(CORE_PLUGINS); - -function DeprecatedOctokit(options) { - const warn = - options && options.log && options.log.warn - ? options.log.warn - : console.warn; - warn( - '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead' - ); - return new OctokitRest(options); -} - -const Octokit = Object.assign(DeprecatedOctokit, { - Octokit: OctokitRest -}); - -Object.keys(OctokitRest).forEach(key => { - /* istanbul ignore else */ - if (OctokitRest.hasOwnProperty(key)) { - Octokit[key] = OctokitRest[key]; - } -}); - -module.exports = Octokit; - - -/***/ }), - /***/ 2: /***/ (function(module, __unusedexports, __webpack_require__) { @@ -288,147 +244,84 @@ function wrappy (fn, cb) { /***/ }), -/***/ 16: -/***/ (function(module) { - -module.exports = require("tls"); - -/***/ }), - -/***/ 18: +/***/ 15: /***/ (function(module) { -module.exports = eval("require")("encoding"); +"use strict"; -/***/ }), +const isWin = process.platform === 'win32'; -/***/ 19: -/***/ (function(module, __unusedexports, __webpack_require__) { +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, + }); +} -module.exports = authenticationPlugin; +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } -const { Deprecation } = __webpack_require__(692); -const once = __webpack_require__(969); + const originalEmit = cp.emit; -const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation)); + 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'); -const authenticate = __webpack_require__(674); -const beforeRequest = __webpack_require__(471); -const requestError = __webpack_require__(349); + if (err) { + return originalEmit.call(cp, 'error', err); + } + } -function authenticationPlugin(octokit, options) { - if (options.auth) { - octokit.authenticate = () => { - deprecateAuthenticate( - octokit.log, - new Deprecation( - '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor' - ) - ); + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params }; - return; - } - const state = { - octokit, - auth: false - }; - octokit.authenticate = authenticate.bind(null, state); - octokit.hook.before("request", beforeRequest.bind(null, state)); - octokit.hook.error("request", requestError.bind(null, state)); } +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } -/***/ }), - -/***/ 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; + return null; } -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); +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } - return result; + return null; } -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, +}; /***/ }), -/***/ 34: +/***/ 16: /***/ (function(module) { -module.exports = require("https"); +module.exports = require("tls"); /***/ }), -/***/ 39: +/***/ 18: /***/ (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: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = factory; - -const Octokit = __webpack_require__(402); -const registerPlugin = __webpack_require__(855); - -function factory(plugins) { - const Api = Octokit.bind(null, plugins || []); - Api.plugin = registerPlugin.bind(null, plugins || []); - return Api; -} +module.exports = eval("require")("encoding"); /***/ }), @@ -473,9 +366,9 @@ const windowsRelease = release => { if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) { let stdout; try { - stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || ''; - } catch (_) { stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || ''; + } catch (_) { + stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || ''; } const year = (stdout.match(/2008|2012|2016|2019/) || [])[0]; @@ -493,1010 +386,303 @@ module.exports = windowsRelease; /***/ }), -/***/ 87: -/***/ (function(module) { - -module.exports = require("os"); - -/***/ }), - -/***/ 118: +/***/ 55: /***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; - -const os = __webpack_require__(87); - -const nameMap = new Map([ - [19, 'Catalina'], - [18, 'Mojave'], - [17, 'High Sierra'], - [16, 'Sierra'], - [15, 'El Capitan'], - [14, 'Yosemite'], - [13, 'Mavericks'], - [12, 'Mountain Lion'], - [11, 'Lion'], - [10, 'Snow Leopard'], - [9, 'Leopard'], - [8, 'Tiger'], - [7, 'Panther'], - [6, 'Jaguar'], - [5, 'Puma'] -]); - -const macosRelease = release => { - release = Number((release || os.release()).split('.')[0]); - return { - name: nameMap.get(release), - version: '10.' + (release - 4) - }; -}; - -module.exports = macosRelease; -// TODO: remove this in the next major version -module.exports.default = macosRelease; - - -/***/ }), - -/***/ 126: -/***/ (function(module) { +module.exports = which +which.sync = whichSync -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ +var isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +var path = __webpack_require__(622) +var COLON = isWindows ? ';' : ':' +var isexe = __webpack_require__(742) -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +function getNotFoundError (cmd) { + var er = new Error('not found: ' + cmd) + er.code = 'ENOENT' -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; + return er +} -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; +function getPathInfo (cmd, opt) { + var colon = opt.colon || COLON + var pathEnv = opt.path || process.env.PATH || '' + var pathExt = [''] -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + pathEnv = pathEnv.split(colon) -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; + var pathExtExe = '' + if (isWindows) { + pathEnv.unshift(process.cwd()) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) + pathEnv = [''] -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } } -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} } - return false; -} -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; + ;(function F (i, l) { + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(getNotFoundError(cmd)) } - } - return -1; -} -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) - while (++index < length) { - if (array[index] === value) { - return index; + var p = path.join(pathPart, cmd) + if (!pathPart && (/^\.[\\\/]/).test(cmd)) { + p = cmd.slice(0, 2) + p } - } - return -1; + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) } -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} +function whichSync (cmd, opt) { + opt = opt || {} -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} + var p = path.join(pathPart, cmd) + if (!pathPart && /^\.[\\\/]/.test(cmd)) { + p = cmd.slice(0, 2) + p + } + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var is + try { + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } } - return result; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} + if (opt.all && found.length) + return found -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; + if (opt.nothrow) + return null -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; + throw getNotFoundError(cmd) +} -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +/***/ }), -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ 87: +/***/ (function(module) { -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +module.exports = require("os"); -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +/***/ }), -/** Built-in value references. */ -var splice = arrayProto.splice; +/***/ 118: +/***/ (function(module, __unusedexports, __webpack_require__) { -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - nativeCreate = getNative(Object, 'create'); +"use strict"; -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +const os = __webpack_require__(87); -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} +const nameMap = new Map([ + [20, ['Big Sur', '11']], + [19, ['Catalina', '10.15']], + [18, ['Mojave', '10.14']], + [17, ['High Sierra', '10.13']], + [16, ['Sierra', '10.12']], + [15, ['El Capitan', '10.11']], + [14, ['Yosemite', '10.10']], + [13, ['Mavericks', '10.9']], + [12, ['Mountain Lion', '10.8']], + [11, ['Lion', '10.7']], + [10, ['Snow Leopard', '10.6']], + [9, ['Leopard', '10.5']], + [8, ['Tiger', '10.4']], + [7, ['Panther', '10.3']], + [6, ['Jaguar', '10.2']], + [5, ['Puma', '10.1']] +]); -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} +const macosRelease = release => { + release = Number((release || os.release()).split('.')[0]); -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} + const [name, version] = nameMap.get(release); -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} + return { + name, + version + }; +}; -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} +module.exports = macosRelease; +// TODO: remove this in the next major version +module.exports.default = macosRelease; -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +/***/ }), -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} +/***/ 127: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +"use strict"; - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; +const httpClient = __importStar(__webpack_require__(539)); +function getAuthString(token, options) { + if (!token && !options.auth) { + throw new Error('Parameter token or opts.auth is required'); + } + else if (token && options.auth) { + throw new Error('Parameters token and opts.auth may not both be specified'); + } + return typeof options.auth === 'string' ? options.auth : `token ${token}`; } - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; +exports.getAuthString = getAuthString; +function getProxyAgent(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgent(destinationUrl); } - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +exports.getProxyAgent = getProxyAgent; +function getApiBaseUrl() { + return process.env['GITHUB_API_URL'] || 'https://api.github.com'; } +exports.getApiBaseUrl = getApiBaseUrl; +//# sourceMappingURL=utils.js.map -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); +/***/ }), - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} +/***/ 129: +/***/ (function(module) { -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; +module.exports = require("child_process"); -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +/***/ }), -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} +/***/ 141: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} +"use strict"; -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} +var net = __webpack_require__(631); +var tls = __webpack_require__(16); +var http = __webpack_require__(605); +var https = __webpack_require__(211); +var events = __webpack_require__(614); +var assert = __webpack_require__(357); +var util = __webpack_require__(669); -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; } -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; } -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -/** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each - * element is kept. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ -function uniq(array) { - return (array && array.length) - ? baseUniq(array) - : []; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -module.exports = uniq; - - -/***/ }), - -/***/ 129: -/***/ (function(module) { - -module.exports = require("child_process"); - -/***/ }), - -/***/ 141: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -var net = __webpack_require__(631); -var tls = __webpack_require__(16); -var http = __webpack_require__(605); -var https = __webpack_require__(34); -var events = __webpack_require__(614); -var assert = __webpack_require__(357); -var util = __webpack_require__(669); - - -exports.httpOverHttp = httpOverHttp; -exports.httpsOverHttp = httpsOverHttp; -exports.httpOverHttps = httpOverHttps; -exports.httpsOverHttps = httpsOverHttps; - - -function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; -} - -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} - -function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; -} - -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; } @@ -1720,36 +906,6 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { exports.debug = debug; // for test -/***/ }), - -/***/ 143: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = withAuthorizationPrefix; - -const atob = __webpack_require__(368); - -const REGEX_IS_BASIC_AUTH = /^[\w-]+:/; - -function withAuthorizationPrefix(authorization) { - if (/^(basic|bearer|token) /i.test(authorization)) { - return authorization; - } - - try { - if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) { - return `basic ${authorization}`; - } - } catch (error) {} - - if (authorization.split(/\./).length === 3) { - return `bearer ${authorization}`; - } - - return `token ${authorization}`; -} - - /***/ }), /***/ 145: @@ -1808,20 +964,6 @@ module.exports.array = (stream, options) => getStream(stream, Object.assign({}, module.exports.MaxBufferError = MaxBufferError; -/***/ }), - -/***/ 148: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = paginatePlugin; - -const { paginateRest } = __webpack_require__(299); - -function paginatePlugin(octokit) { - Object.assign(octokit, paginateRest(octokit)); -} - - /***/ }), /***/ 168: @@ -1871,89 +1013,6 @@ module.exports = opts => { }; -/***/ }), - -/***/ 190: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = authenticationPlugin; - -const { createTokenAuth } = __webpack_require__(813); -const { Deprecation } = __webpack_require__(692); -const once = __webpack_require__(969); - -const beforeRequest = __webpack_require__(863); -const requestError = __webpack_require__(293); -const validate = __webpack_require__(954); -const withAuthorizationPrefix = __webpack_require__(143); - -const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation)); -const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation)); - -function authenticationPlugin(octokit, options) { - // If `options.authStrategy` is set then use it and pass in `options.auth` - if (options.authStrategy) { - const auth = options.authStrategy(options.auth); - octokit.hook.wrap("request", auth.hook); - octokit.auth = auth; - return; - } - - // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred. - if (!options.auth) { - octokit.auth = () => - Promise.resolve({ - type: "unauthenticated" - }); - return; - } - - const isBasicAuthString = - typeof options.auth === "string" && - /^basic/.test(withAuthorizationPrefix(options.auth)); - - // If only `options.auth` is set to a string, use the default token authentication strategy. - if (typeof options.auth === "string" && !isBasicAuthString) { - const auth = createTokenAuth(options.auth); - octokit.hook.wrap("request", auth.hook); - octokit.auth = auth; - return; - } - - // Otherwise log a deprecation message - const [deprecationMethod, deprecationMessapge] = isBasicAuthString - ? [ - deprecateAuthBasic, - 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)' - ] - : [ - deprecateAuthObject, - 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)' - ]; - deprecationMethod( - octokit.log, - new Deprecation("[@octokit/rest] " + deprecationMessapge) - ); - - octokit.auth = () => - Promise.resolve({ - type: "deprecated", - message: deprecationMessapge - }); - - validate(options.auth); - - const state = { - octokit, - auth: options.auth - }; - - octokit.hook.before("request", beforeRequest.bind(null, state)); - octokit.hook.error("request", requestError.bind(null, state)); -} - - /***/ }), /***/ 197: @@ -2004,42 +1063,188 @@ function checkMode (stat, options) { /***/ }), -/***/ 211: +/***/ 198: /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = __importStar(__webpack_require__(470)); +const github = __importStar(__webpack_require__(469)); +const util_1 = __webpack_require__(669); +const command_helper_1 = __webpack_require__(372); +const octokit_client_1 = __webpack_require__(921); +function run() { + return __awaiter(this, void 0, void 0, function* () { + try { + // Check required context properties exist (satisfy type checking) + if (!github.context.payload.action || + !github.context.payload.issue || + !github.context.payload.comment) { + throw new Error('Required context properties are missing.'); + } + // Only handle 'created' and 'edited' event types + if (!['created', 'edited'].includes(github.context.payload.action)) { + core.warning(`Event type '${github.context.payload.action}' not supported.`); + return; + } + // Get action inputs + const inputs = command_helper_1.getInputs(); + core.debug(`Inputs: ${util_1.inspect(inputs)}`); + // Check required inputs + if (!inputs.token) { + throw new Error(`Missing required input 'token'.`); + } + // Get configuration for registered commands + const config = command_helper_1.getCommandsConfig(inputs); + core.debug(`Commands config: ${util_1.inspect(config)}`); + // Check the config is valid + if (!command_helper_1.configIsValid(config)) + return; + // Get the comment body and id + const commentBody = github.context.payload.comment.body; + const commentId = github.context.payload.comment.id; + core.debug(`Comment body: ${commentBody}`); + core.debug(`Comment id: ${commentId}`); + // Check if the first line of the comment is a slash command + const firstLine = commentBody.split(/\r?\n/)[0].trim(); + if (firstLine.length < 2 || firstLine.charAt(0) != '/') { + console.debug('The first line of the comment is not a valid slash command.'); + return; + } + // Split the first line into "words" + const commandWords = firstLine.slice(1).split(' '); + core.debug(`Command words: ${util_1.inspect(commandWords)}`); + // Check if the command is registered for dispatch + let configMatches = config.filter(function (cmd) { + return cmd.command == commandWords[0]; + }); + core.debug(`Config matches on 'command': ${util_1.inspect(configMatches)}`); + if (configMatches.length == 0) { + core.info(`Command '${commandWords[0]}' is not registered for dispatch.`); + return; + } + // Filter matching commands by issue type + const isPullRequest = 'pull_request' in github.context.payload.issue; + configMatches = configMatches.filter(function (cmd) { + return (cmd.issue_type == 'both' || + (cmd.issue_type == 'issue' && !isPullRequest) || + (cmd.issue_type == 'pull-request' && isPullRequest)); + }); + core.debug(`Config matches on 'issue_type': ${util_1.inspect(configMatches)}`); + if (configMatches.length == 0) { + const issueType = isPullRequest ? 'pull request' : 'issue'; + core.info(`Command '${commandWords[0]}' is not configured for the issue type '${issueType}'.`); + return; + } + // Filter matching commands by whether or not to allow edits + if (github.context.payload.action == 'edited') { + configMatches = configMatches.filter(function (cmd) { + return cmd.allow_edits; + }); + core.debug(`Config matches on 'allow_edits': ${util_1.inspect(configMatches)}`); + if (configMatches.length == 0) { + core.info(`Command '${commandWords[0]}' is not configured to allow edits.`); + return; + } + } + // Set octokit clients + const octokit = new octokit_client_1.Octokit({ auth: `${inputs.token}` }); + const reactionOctokit = new octokit_client_1.Octokit({ auth: `${inputs.reactionToken}` }); + // At this point we know the command is registered + // Add the "eyes" reaction to the comment + if (inputs.reactions) + yield command_helper_1.addReaction(reactionOctokit, github.context.repo, commentId, 'eyes'); + // Get the actor permission + const actorPermission = yield command_helper_1.getActorPermission(octokit, github.context.repo, github.context.actor); + core.debug(`Actor permission: ${actorPermission}`); + // Filter matching commands by the user's permission level + configMatches = configMatches.filter(function (cmd) { + return command_helper_1.actorHasPermission(actorPermission, cmd.permission); + }); + core.debug(`Config matches on 'permission': ${util_1.inspect(configMatches)}`); + if (configMatches.length == 0) { + core.info(`Command '${commandWords[0]}' is not configured for the user's permission level '${actorPermission}'.`); + return; + } + // Determined that the command should be dispatched + core.info(`Command '${commandWords[0]}' to be dispatched.`); + // Define payload + const clientPayload = { + slash_command: {}, + github: github.context + }; + // Get the pull request context for the dispatch payload + if (isPullRequest) { + const { data: pullRequest } = yield octokit.pulls.get(Object.assign(Object.assign({}, github.context.repo), { pull_number: github.context.payload.issue.number })); + clientPayload['pull_request'] = pullRequest; + } + // Dispatch for each matching configuration + for (const cmd of configMatches) { + // Generate slash command payload + clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords, cmd.named_args); + core.debug(`Slash command payload: ${util_1.inspect(clientPayload.slash_command)}`); + // Dispatch the command + const dispatchRepo = cmd.repository.split('/'); + const eventType = cmd.command + cmd.event_type_suffix; + yield octokit.repos.createDispatchEvent({ + owner: dispatchRepo[0], + repo: dispatchRepo[1], + event_type: eventType, + client_payload: clientPayload + }); + core.info(`Command '${cmd.command}' dispatched to '${cmd.repository}' ` + + `with event type '${eventType}'.`); + } + // Add the "rocket" reaction to the comment + if (inputs.reactions) + yield command_helper_1.addReaction(reactionOctokit, github.context.repo, commentId, 'rocket'); + } + catch (error) { + core.debug(util_1.inspect(error)); + core.setFailed(error.message); + } + }); +} +run(); -Object.defineProperty(exports, '__esModule', { value: true }); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } +/***/ }), -var osName = _interopDefault(__webpack_require__(2)); +/***/ 211: +/***/ (function(module) { -function getUserAgent() { - try { - return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`; - } catch (error) { - if (/wmic os get Caption/.test(error.message)) { - return "Windows "; - } +module.exports = require("https"); - return ""; - } -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 215: -/***/ (function(module) { - -module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_from":"@octokit/rest@16.43.1"}; - -/***/ }), +/***/ }), /***/ 260: /***/ (function(module, __unusedexports, __webpack_require__) { @@ -2049,6 +1254,7 @@ module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"a // ignored, since we can never get coverage for them. var assert = __webpack_require__(357) var signals = __webpack_require__(654) +var isWin = /^win/i.test(process.platform) var EE = __webpack_require__(614) /* istanbul ignore if */ @@ -2138,6 +1344,11 @@ signals.forEach(function (sig) { /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } process.kill(process.pid, sig) } } @@ -2211,6 +1422,7 @@ function processEmit (ev, arg) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.Context = void 0; const fs_1 = __webpack_require__(747); const os_1 = __webpack_require__(87); class Context { @@ -2234,6 +1446,9 @@ class Context { this.workflow = process.env.GITHUB_WORKFLOW; this.action = process.env.GITHUB_ACTION; this.actor = process.env.GITHUB_ACTOR; + this.job = process.env.GITHUB_JOB; + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); } get issue() { const payload = this.payload; @@ -2258,2961 +1473,3084 @@ exports.Context = Context; /***/ }), -/***/ 265: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = getPage +/***/ 280: +/***/ (function(module) { -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) -const HttpError = __webpack_require__(297) +module.exports = register -function getPage (octokit, link, which, headers) { - deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`) - const url = getPageLinks(link)[which] +function register (state, name, method, options) { + if (typeof method !== 'function') { + throw new Error('method for before hook must be a function') + } - if (!url) { - const urlError = new HttpError(`No ${which} page found`, 404) - return Promise.reject(urlError) + if (!options) { + options = {} } - const requestOptions = { - url, - headers: applyAcceptHeader(link, headers) + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options) + }, method)() } - const promise = octokit.request(requestOptions) + return Promise.resolve() + .then(function () { + if (!state.registry[name]) { + return method(options) + } - return promise + return (state.registry[name]).reduce(function (method, registered) { + return registered.hook.bind(null, method, options) + }, method)() + }) } -function applyAcceptHeader (res, headers) { - const previous = res.headers && res.headers['x-github-media-type'] - if (!previous || (headers && headers.accept)) { - return headers - } - headers = headers || {} - headers.accept = 'application/vnd.' + previous - .replace('; param=', '.') - .replace('; format=', '+') +/***/ }), - return headers -} +/***/ 299: +/***/ (function(__unusedmodule, exports) { +"use strict"; -/***/ }), -/***/ 280: -/***/ (function(module, exports) { +Object.defineProperty(exports, '__esModule', { value: true }); -exports = module.exports = SemVer +const VERSION = "2.2.3"; -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) +/** + * Some “list” response that can be paginated have a different response structure + * + * They have a `total_count` key in the response (search also has `incomplete_results`, + * /installation/repositories also has `repository_selection`), as well as a key with + * the list of the items which name varies from endpoint to endpoint. + * + * Octokit normalizes these responses so that paginated results are always returned following + * the same structure. One challenge is that if the list response has only one page, no Link + * header is provided, so this header alone is not sufficient to check wether a response is + * paginated or not. + * + * We check if a "total_count" key is present in the response data, but also make sure that + * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would + * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + */ +function normalizePaginatedListResponse(response) { + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); + if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way + // to retrieve the same information. + + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + const namespaceKey = Object.keys(response.data)[0]; + const data = response.data[namespaceKey]; + response.data = data; + + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; } -} else { - debug = function () {} + + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } + + response.data.total_count = totalCount; + return response; } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + next() { + if (!url) { + return Promise.resolve({ + done: true + }); + } -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 + return requestMethod({ + method, + url, + headers + }).then(normalizePaginatedListResponse).then(response => { + // `response.headers.link` format: + // '; rel="next", ; rel="last"' + // sets `url` to undefined if "next" URL is not present or `link` header is not set + url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { + value: response + }; + }); + } -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 + }) + }; +} -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var R = 0 +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = undefined; + } -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. + return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +} -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. +function gather(octokit, results, iterator, mapFn) { + return iterator.next().then(result => { + if (result.done) { + return results; + } -var NUMERICIDENTIFIER = R++ -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' -var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' + let earlyExit = false; -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. + function done() { + earlyExit = true; + } -var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); -// ## Main Version -// Three dot-separated numeric identifiers. + if (earlyExit) { + return results; + } -var MAINVERSION = R++ -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')' + return gather(octokit, results, iterator, mapFn); + }); +} -var MAINVERSIONLOOSE = R++ -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')' +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) + }; +} +paginateRest.VERSION = VERSION; -var PRERELEASEIDENTIFIER = R++ -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')' +exports.paginateRest = paginateRest; +//# sourceMappingURL=index.js.map -var PRERELEASEIDENTIFIERLOOSE = R++ -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')' -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. +/***/ }), -var PRERELEASE = R++ -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' +/***/ 306: +/***/ (function(module, __unusedexports, __webpack_require__) { -var PRERELEASELOOSE = R++ -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' +"use strict"; -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. -var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +const fs = __webpack_require__(747); +const shebangCommand = __webpack_require__(907); -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + let buffer; -var BUILD = R++ -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + 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 + } -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + let fd; -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } -var FULL = R++ -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?' + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} -src[FULL] = '^' + FULLPLAIN + '$' +module.exports = readShebang; -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?' -var LOOSE = R++ -src[LOOSE] = '^' + LOOSEPLAIN + '$' +/***/ }), -var GTLT = R++ -src[GTLT] = '((?:<|>)?=?)' +/***/ 323: +/***/ (function(module) { -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++ -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -var XRANGEIDENTIFIER = R++ -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' +"use strict"; -var XRANGEPLAIN = R++ -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?' -var XRANGEPLAINLOOSE = R++ -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?' +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; -var XRANGE = R++ -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' -var XRANGELOOSE = R++ -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++ -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++ -src[LONETILDE] = '(?:~>?)' +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; -var TILDETRIM = R++ -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') -var tildeTrimReplace = '$1~' +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; -var TILDE = R++ -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' -var TILDELOOSE = R++ -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++ -src[LONECARET] = '(?:\\^)' +/***/ }), -var CARETTRIM = R++ -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') -var caretTrimReplace = '$1^' +/***/ 357: +/***/ (function(module) { -var CARET = R++ -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' -var CARETLOOSE = R++ -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' +module.exports = require("assert"); -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++ -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' -var COMPARATOR = R++ -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' +/***/ }), -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++ -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' +/***/ 372: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' +"use strict"; -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++ -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$' +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSlashCommandPayload = exports.addReaction = exports.getActorPermission = exports.actorHasPermission = exports.configIsValid = exports.getCommandsConfigFromJson = exports.getCommandsConfigFromInputs = exports.getCommandsConfig = exports.getInputs = exports.toBool = exports.commandDefaults = exports.MAX_ARGS = void 0; +const core = __importStar(__webpack_require__(470)); +const fs = __importStar(__webpack_require__(747)); +const util_1 = __webpack_require__(669); +const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/; +exports.MAX_ARGS = 50; +exports.commandDefaults = Object.freeze({ + permission: 'write', + issue_type: 'both', + allow_edits: false, + repository: process.env.GITHUB_REPOSITORY || '', + event_type_suffix: '-command', + named_args: false +}); +function toBool(input, defaultVal) { + if (typeof input === 'boolean') { + return input; + } + else if (typeof input === 'undefined' || input.length == 0) { + return defaultVal; + } + else { + return input === 'true'; + } +} +exports.toBool = toBool; +function getInputs() { + // Defaults set in action.yml + return { + token: core.getInput('token'), + reactionToken: core.getInput('reaction-token'), + reactions: core.getInput('reactions') === 'true', + commands: core.getInput('commands'), + permission: core.getInput('permission'), + issueType: core.getInput('issue-type'), + allowEdits: core.getInput('allow-edits') === 'true', + repository: core.getInput('repository'), + eventTypeSuffix: core.getInput('event-type-suffix'), + namedArgs: core.getInput('named-args') === 'true', + config: core.getInput('config'), + configFromFile: core.getInput('config-from-file') + }; +} +exports.getInputs = getInputs; +function getCommandsConfig(inputs) { + if (inputs.configFromFile) { + core.info(`Using JSON configuration from file '${inputs.configFromFile}'.`); + const json = fs.readFileSync(inputs.configFromFile, { + encoding: 'utf8' + }); + return getCommandsConfigFromJson(json); + } + else if (inputs.config) { + core.info(`Using JSON configuration from 'config' input.`); + return getCommandsConfigFromJson(inputs.config); + } + else { + core.info(`Using configuration from yaml inputs.`); + return getCommandsConfigFromInputs(inputs); + } +} +exports.getCommandsConfig = getCommandsConfig; +function getCommandsConfigFromInputs(inputs) { + // Get commands + const commands = inputs.commands.replace(/\s+/g, '').split(','); + core.debug(`Commands: ${util_1.inspect(commands)}`); + // Build config + const config = []; + for (const c of commands) { + const cmd = { + command: c, + permission: inputs.permission, + issue_type: inputs.issueType, + allow_edits: inputs.allowEdits, + repository: inputs.repository, + event_type_suffix: inputs.eventTypeSuffix, + named_args: inputs.namedArgs + }; + config.push(cmd); + } + return config; +} +exports.getCommandsConfigFromInputs = getCommandsConfigFromInputs; +function getCommandsConfigFromJson(json) { + const jsonConfig = JSON.parse(json); + core.debug(`JSON config: ${util_1.inspect(jsonConfig)}`); + const config = []; + for (const jc of jsonConfig) { + const cmd = { + command: jc.command, + permission: jc.permission ? jc.permission : exports.commandDefaults.permission, + issue_type: jc.issue_type ? jc.issue_type : exports.commandDefaults.issue_type, + allow_edits: toBool(jc.allow_edits, exports.commandDefaults.allow_edits), + repository: jc.repository ? jc.repository : exports.commandDefaults.repository, + event_type_suffix: jc.event_type_suffix + ? jc.event_type_suffix + : exports.commandDefaults.event_type_suffix, + named_args: toBool(jc.named_args, exports.commandDefaults.named_args) + }; + config.push(cmd); + } + return config; +} +exports.getCommandsConfigFromJson = getCommandsConfigFromJson; +function configIsValid(config) { + for (const command of config) { + if (!['none', 'read', 'write', 'admin'].includes(command.permission)) { + core.setFailed(`'${command.permission}' is not a valid 'permission'.`); + return false; + } + if (!['issue', 'pull-request', 'both'].includes(command.issue_type)) { + core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`); + return false; + } + } + return true; +} +exports.configIsValid = configIsValid; +function actorHasPermission(actorPermission, commandPermission) { + const permissionLevels = Object.freeze({ + none: 1, + read: 2, + write: 3, + admin: 4 + }); + core.debug(`Actor permission level: ${permissionLevels[actorPermission]}`); + core.debug(`Command permission level: ${permissionLevels[commandPermission]}`); + return (permissionLevels[actorPermission] >= permissionLevels[commandPermission]); +} +exports.actorHasPermission = actorHasPermission; +function getActorPermission(octokit, repo, actor) { + return __awaiter(this, void 0, void 0, function* () { + const { data: { permission } } = yield octokit.repos.getCollaboratorPermissionLevel(Object.assign(Object.assign({}, repo), { username: actor })); + return permission; + }); +} +exports.getActorPermission = getActorPermission; +function addReaction(octokit, repo, commentId, reaction) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield octokit.reactions.createForIssueComment(Object.assign(Object.assign({}, repo), { comment_id: commentId, content: reaction })); + } + catch (error) { + core.debug(util_1.inspect(error)); + core.warning(`Failed to set reaction on comment ID ${commentId}.`); + } + }); +} +exports.addReaction = addReaction; +function getSlashCommandPayload(commandWords, namedArgs) { + const payload = { + command: commandWords[0], + args: '' + }; + if (commandWords.length > 1) { + const argWords = commandWords.slice(1, exports.MAX_ARGS + 1); + payload.args = argWords.join(' '); + // Parse named and unnamed args + let unnamedCount = 1; + const unnamedArgs = []; + for (const argWord of argWords) { + if (namedArgs && NAMED_ARG_PATTERN.test(argWord)) { + const result = NAMED_ARG_PATTERN.exec(argWord); + if (result && result.groups) { + payload[`${result.groups['name']}`] = result.groups['value']; + } + } + else { + unnamedArgs.push(argWord); + payload[`arg${unnamedCount}`] = argWord; + unnamedCount += 1; + } + } + // Add a string of only the unnamed args + if (namedArgs && unnamedArgs.length > 0) { + payload['unnamed_args'] = unnamedArgs.join(' '); + } + } + return payload; +} +exports.getSlashCommandPayload = getSlashCommandPayload; -var HYPHENRANGELOOSE = R++ -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$' -// Star ranges basically just allow anything at all. -var STAR = R++ -src[STAR] = '(<|>)?=?\\s*\\*' +/***/ }), -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} +/***/ 385: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +"use strict"; - if (version instanceof SemVer) { - return version - } - if (typeof version !== 'string') { - return null - } +Object.defineProperty(exports, '__esModule', { value: true }); - if (version.length > MAX_LENGTH) { - return null - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - var r = options.loose ? re[LOOSE] : re[FULL] - if (!r.test(version)) { - return null - } +var isPlainObject = _interopDefault(__webpack_require__(696)); +var universalUserAgent = __webpack_require__(562); - try { - return new SemVer(version, options) - } catch (er) { - return null +function lowercaseKeys(object) { + if (!object) { + return {}; } -} - -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); } -exports.SemVer = SemVer - -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach(key => { + if (isPlainObject(options[key])) { + if (!(key in defaults)) Object.assign(result, { + [key]: options[key] + });else result[key] = mergeDeep(defaults[key], options[key]); } else { - version = version.version + Object.assign(result, { + [key]: options[key] + }); } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } + }); + return result; +} - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { + method, + url + } : { + url: method + }, options); + } else { + options = Object.assign({}, route); + } // lowercase header names before merging with defaults to avoid duplicates - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + options.headers = lowercaseKeys(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten - if (!m) { - throw new TypeError('Invalid Version: ' + version) + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); } - this.raw = version + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') + if (names.length === 0) { + return url; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); +} - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +const urlVariableRegex = /\{[^}]+\}/g; - this.build = m[5] ? m[5].split('.') : [] - this.format() +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); } -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + + if (!matches) { + return []; } - return this.version + + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); } -SemVer.prototype.toString = function () { - return this.version +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); } -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +// Based on https://github.com/bramstein/url-template, licensed under BSD +// TODO: create separate package. +// +// Copyright (c) 2012-2014, Bram Stein +// All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - return this.compareMain(other) || this.comparePre(other) -} +/* istanbul ignore file */ +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } + return part; + }).join(""); +} - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); } -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; } +} - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) +function isDefined(value) { + return value !== undefined && value !== null; } -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} + +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; + + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); } - this.inc('pre', identifier) - break - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } + const tmp = []; + + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + tmp.push(encodeValue(operator, value)); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) + + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); } } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } + } + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); } - break - - default: - throw new Error('invalid increment argument: ' + release) + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } } - this.format() - this.raw = this.version - return this -} -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } + return result; +} - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; } -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } + + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + + if (operator && operator !== "+") { + var separator = ","; + + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; } + + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); } + } else { + return encodeReserved(literal); } - return defaultResult // may be undefined - } + }); } -exports.compareIdentifiers = compareIdentifiers +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later - if (anum && bnum) { - a = +a - b = +b + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + + if (!/^http/.test(url)) { + url = options.baseUrl + url; } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} + const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequset = /application\/octet-stream/i.test(headers.accept); -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} + if (!isBinaryRequset) { + if (options.mediaType.format) { + // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw + headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); + } -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} + if (options.mediaType.previews.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); + } + } // for GET/HEAD requests, set URL query parameters from remaining parameters + // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; + } else { + headers["content-length"] = 0; + } + } + } // default content-type for JSON if body is set -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. + // fetch does not allow to set `content-length` header, but we can set body to an empty string -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compare(a, b, loose) - }) -} + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.rcompare(a, b, loose) - }) -} -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); } -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); } -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS = merge(oldDefaults, newDefaults); + const endpoint = endpointWithDefaults.bind(null, DEFAULTS); + return Object.assign(endpoint, { + DEFAULTS, + defaults: withDefaults.bind(null, DEFAULTS), + merge: merge.bind(null, DEFAULTS), + parse + }); } -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} +const VERSION = "6.0.4"; -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} +const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. +// So we use RequestParameters and add method as additional required property. -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} +const DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "", + previews: [] + } +}; -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b +const endpoint = withDefaults(null, DEFAULTS); - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b +exports.endpoint = endpoint; +//# sourceMappingURL=index.js.map - case '': - case '=': - case '==': - return eq(a, b, loose) - case '!=': - return neq(a, b, loose) +/***/ }), - case '>': - return gt(a, b, loose) +/***/ 392: +/***/ (function(__unusedmodule, exports) { - case '>=': - return gte(a, b, loose) +"use strict"; - case '<': - return lt(a, b, loose) - case '<=': - return lte(a, b, loose) +Object.defineProperty(exports, '__esModule', { value: true }); - default: - throw new TypeError('Invalid operator: ' + op) +function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; } -} -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } + return ""; +} - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } +exports.getUserAgent = getUserAgent; +//# sourceMappingURL=index.js.map - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } +/***/ }), - debug('comp', this) -} +/***/ 413: +/***/ (function(module, __unusedexports, __webpack_require__) { -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var m = comp.match(r) +module.exports = __webpack_require__(141); - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } - this.operator = m[1] - if (this.operator === '=') { - this.operator = '' - } +/***/ }), - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} +/***/ 427: +/***/ (function(module, __unusedexports, __webpack_require__) { -Comparator.prototype.toString = function () { - return this.value -} +"use strict"; -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) +// Older verions of Node.js might not have `util.getSystemErrorName()`. +// In that case, fall back to a deprecated internal. +const util = __webpack_require__(669); - if (this.semver === ANY) { - return true - } +let uv; - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } +if (typeof util.getSystemErrorName === 'function') { + module.exports = util.getSystemErrorName; +} else { + try { + uv = process.binding('uv'); - return cmp(version, this.operator, this.semver, this.options) + if (typeof uv.errname !== 'function') { + throw new TypeError('uv.errname is not a function'); + } + } catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; + } + + module.exports = code => errname(uv, code); } -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +// Used for testing the fallback behavior +module.exports.__test__ = errname; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +function errname(uv, code) { + if (uv) { + return uv.errname(code); + } - var rangeTmp + if (!(code < 0)) { + throw new Error('err >= 0'); + } - if (this.operator === '') { - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } + return `Unknown system error ${code}`; +} - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/***/ }), - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) +/***/ 431: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +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 }); +const os = __importStar(__webpack_require__(87)); +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; } - } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + 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) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function escapeProperty(s) { + return toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} +//# sourceMappingURL=command.js.map - if (range instanceof Comparator) { - return new Range(range.value, options) - } +/***/ }), - if (!(this instanceof Range)) { - return new Range(range, options) - } +/***/ 448: +/***/ (function(__unusedmodule, exports, __webpack_require__) { - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +"use strict"; - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) +Object.defineProperty(exports, '__esModule', { value: true }); + +var universalUserAgent = __webpack_require__(796); +var beforeAfterHook = __webpack_require__(523); +var request = __webpack_require__(753); +var graphql = __webpack_require__(898); +var authToken = __webpack_require__(813); + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; } - this.format() + return obj; } -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; } -Range.prototype.toString = function () { - return this.range +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; } -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[COMPARATORTRIM]) +const VERSION = "3.1.0"; + +class Octokit { + constructor(options = {}) { + const hook = new beforeAfterHook.Collection(); + const requestDefaults = { + baseUrl: request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + hook: hook.bind(null, "request") + }), + mediaType: { + previews: [], + format: "" + } + }; // prepend default user agent with `options.userAgent` if set - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) + requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; + } - // normalize spaces - range = range.split(/\s+/).join(' ') + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; + } - // At this point, the range is completely trimmed and - // ready to be split into comparators. + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; + } - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) + this.request = request.request.defaults(requestDefaults); + this.graphql = graphql.withCustomRequest(this.request).defaults(_objectSpread2(_objectSpread2({}, requestDefaults), {}, { + baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api") + })); + this.log = Object.assign({ + debug: () => {}, + info: () => {}, + warn: console.warn.bind(console), + error: console.error.bind(console) + }, options.log); + this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. + // (2) If only `options.auth` is set, use the default token authentication strategy. + // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. + // TODO: type `options.auth` based on `options.authStrategy`. + + if (!options.authStrategy) { + if (!options.auth) { + // (1) + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + // (2) + const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const auth = options.authStrategy(Object.assign({ + request: this.request + }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } // apply plugins + // https://stackoverflow.com/a/16345172 + + + const classConstructor = this.constructor; + classConstructor.plugins.forEach(plugin => { + Object.assign(this, plugin(this, options)); + }); } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - return set -} + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null)); + } + + }; + return OctokitWithDefaults; } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ - return this.set.some(function (thisComparators) { - return thisComparators.every(function (thisComparator) { - return range.set.some(function (rangeComparators) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - }) - }) -} -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} + static plugin(...newPlugins) { + var _a; -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} + const currentPlugins = this.plugins; + const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); + return NewOctokit; + } -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' } +Octokit.VERSION = VERSION; +Octokit.plugins = []; -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map -function replaceTilde (comp, options) { - var r = options.loose ? re[TILDELOOSE] : re[TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } +/***/ }), - debug('tilde return', ret) - return ret - }) -} +/***/ 453: +/***/ (function(module, __unusedexports, __webpack_require__) { -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} +var once = __webpack_require__(969) +var eos = __webpack_require__(9) +var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[CARETLOOSE] : re[CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } +var isFn = function (fn) { + return typeof fn === 'function' +} - debug('caret return', ret) - return ret - }) +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) } -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) - if (gtlt === '=' && anyX) { - gtlt = '' - } + var closed = false + stream.on('close', function () { + closed = true + }) - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true - ret = gtlt + M + '.' + m + '.' + p - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - debug('xRange return', ret) + if (isFn(stream.destroy)) return stream.destroy() - return ret - }) + callback(err || new Error('stream was destroyed')) + } } -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], '') +var call = function (fn) { + fn() } -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } +var pipe = function (from, to) { + return from.pipe(to) +} - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - return (from + ' ' + to).trim() + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') + + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) + + return streams.reduce(pipe) } -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } +module.exports = pump - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } +/***/ }), - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } +/***/ 454: +/***/ (function(module, exports, __webpack_require__) { - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } +"use strict"; - // Version has a -pre, but it's not one of the ones we like. - return false - } - return true -} +Object.defineProperty(exports, '__esModule', { value: true }); -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} +var Stream = _interopDefault(__webpack_require__(794)); +var http = _interopDefault(__webpack_require__(605)); +var Url = _interopDefault(__webpack_require__(835)); +var https = _interopDefault(__webpack_require__(211)); +var zlib = _interopDefault(__webpack_require__(761)); -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } +class Blob { + constructor() { + this[TYPE] = ''; - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] + const blobParts = arguments[0]; + const options = arguments[1]; - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } + const buffers = []; + let size = 0; - if (minver && range.test(minver)) { - return minver - } + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } - return null -} + this[BUFFER] = Buffer.concat(buffers); -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } } -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) - - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - var high = null - var low = null - - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); -exports.coerce = coerce -function coerce (version) { - if (version instanceof SemVer) { - return version - } +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ - if (typeof version !== 'string') { - return null - } +/** + * Create FetchError instance + * + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError + */ +function FetchError(message, type, systemError) { + Error.call(this, message); - var match = version.match(re[COERCE]) + this.message = message; + this.type = type; - if (match == null) { - return null + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; } - return parse(match[1] + - '.' + (match[2] || '0') + - '.' + (match[3] || '0')) + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); } +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; -/***/ }), - -/***/ 293: -/***/ (function(module, __unusedexports, __webpack_require__) { +let convert; +try { + convert = __webpack_require__(18).convert; +} catch (e) {} -module.exports = authenticationRequestError; +const INTERNALS = Symbol('Body internals'); -const { RequestError } = __webpack_require__(497); +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; -function authenticationRequestError(state, error, options) { - if (!error.headers) throw error; +/** + * Body mixin + * + * Ref: https://fetch.spec.whatwg.org/#body + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +function Body(body) { + var _this = this; - const otpRequired = /required/.test(error.headers["x-github-otp"] || ""); - // handle "2FA required" error only - if (error.status !== 401 || !otpRequired) { - throw error; - } + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; - if ( - error.status === 401 && - otpRequired && - error.request && - error.request.headers["x-github-otp"] - ) { - if (state.otp) { - delete state.otp; // no longer valid, request again - } else { - throw new RequestError( - "Invalid one-time password for two-factor authentication", - 401, - { - headers: error.headers, - request: options - } - ); - } - } + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - if (typeof state.auth.on2fa !== "function") { - throw new RequestError( - "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication", - 401, - { - headers: error.headers, - request: options - } - ); - } + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; - return Promise.resolve() - .then(() => { - return state.auth.on2fa(); - }) - .then(oneTimePassword => { - const newOptions = Object.assign(options, { - headers: Object.assign(options.headers, { - "x-github-otp": oneTimePassword - }) - }); - return state.octokit.request(newOptions).then(response => { - // If OTP still valid, then persist it for following requests - state.otp = oneTimePassword; - return response; - }); - }); + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } } +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, -/***/ }), - -/***/ 294: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = parseOptions; + get bodyUsed() { + return this[INTERNALS].disturbed; + }, -const { Deprecation } = __webpack_require__(692); -const { getUserAgent } = __webpack_require__(796); -const once = __webpack_require__(969); + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, -const pkg = __webpack_require__(215); + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, -const deprecateOptionsTimeout = once((log, deprecation) => - log.warn(deprecation) -); -const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation)); -const deprecateOptionsHeaders = once((log, deprecation) => - log.warn(deprecation) -); + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; -function parseOptions(options, log, hook) { - if (options.headers) { - options.headers = Object.keys(options.headers).reduce((newObj, key) => { - newObj[key.toLowerCase()] = options.headers[key]; - return newObj; - }, {}); - } + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, - const clientDefaults = { - headers: options.headers || {}, - request: options.request || {}, - mediaType: { - previews: [], - format: "" - } - }; + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, - if (options.baseUrl) { - clientDefaults.baseUrl = options.baseUrl; - } + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, - if (options.userAgent) { - clientDefaults.headers["user-agent"] = options.userAgent; - } + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; - if (options.previews) { - clientDefaults.mediaType.previews = options.previews; - } + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } +}; - if (options.timeZone) { - clientDefaults.headers["time-zone"] = options.timeZone; - } +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); - if (options.timeout) { - deprecateOptionsTimeout( - log, - new Deprecation( - "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request" - ) - ); - clientDefaults.request.timeout = options.timeout; - } +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; - if (options.agent) { - deprecateOptionsAgent( - log, - new Deprecation( - "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request" - ) - ); - clientDefaults.request.agent = options.agent; - } +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; - if (options.headers) { - deprecateOptionsHeaders( - log, - new Deprecation( - "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request" - ) - ); - } + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } - const userAgentOption = clientDefaults.headers["user-agent"]; - const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`; + this[INTERNALS].disturbed = true; - clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent] - .filter(Boolean) - .join(" "); + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } - clientDefaults.request.hook = hook.bind(null, "request"); + let body = this.body; - return clientDefaults; -} + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + // body is blob + if (isBlob(body)) { + body = body.stream(); + } -/***/ }), + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } -/***/ 297: -/***/ (function(module) { + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } -module.exports = class HttpError extends Error { - constructor (message, code, headers) { - super(message) + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; - // Maintains proper stack trace (only available on V8) - /* istanbul ignore next */ - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor) - } + return new Body.Promise(function (resolve, reject) { + let resTimeout; - this.name = 'HttpError' - this.code = code - this.headers = headers - } -} + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); -/***/ }), + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } -/***/ 299: -/***/ (function(__unusedmodule, exports) { + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } -"use strict"; + accumBytes += chunk.length; + accum.push(chunk); + }); + body.on('end', function () { + if (abort) { + return; + } -Object.defineProperty(exports, '__esModule', { value: true }); + clearTimeout(resTimeout); -const VERSION = "1.1.2"; + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} /** - * Some “list” response that can be paginated have a different response structure - * - * They have a `total_count` key in the response (search also has `incomplete_results`, - * /installation/repositories also has `repository_selection`), as well as a key with - * the list of the items which name varies from endpoint to endpoint: - * - * - https://developer.github.com/v3/search/#example (key `items`) - * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`) - * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`) - * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`) - * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`) + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding * - * Octokit normalizes these responses so that paginated results are always returned following - * the same structure. One challenge is that if the list response has only one page, no Link - * header is provided, so this header alone is not sufficient to check wether a response is - * paginated or not. For the exceptions with the namespace, a fallback check for the route - * paths has to be added in order to normalize the response. We cannot check for the total_count - * property because it also exists in the response of Get the combined status for a specific ref. + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String */ -const REGEX = [/^\/search\//, /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, /^\/installation\/repositories([^/]|$)/, /^\/user\/installations([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/]; -function normalizePaginatedListResponse(octokit, url, response) { - const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, ""); - const responseNeedsNormalization = REGEX.find(regex => regex.test(path)); - if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way - // to retrieve the same information. +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); - response.data.total_count = totalCount; - Object.defineProperty(response.data, namespaceKey, { - get() { - octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`); - return Array.from(data); - } + // html5 + if (!res && str) { + res = / ({ - next() { - if (!url) { - return Promise.resolve({ - done: true - }); - } + if (res) { + res = /charset=(.*)/i.exec(res.pop()); + } + } - return octokit.request({ - method, - url, - headers - }).then(response => { - normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format: - // '; rel="next", ; rel="last"' - // sets `url` to undefined if "next" URL is not present or `link` header is not set + // xml + if (!res && str) { + res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str); + } - url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { - value: response - }; - }); - } + // found charset + if (res) { + charset = res.pop(); - }) - }; + // prevent decode issues when sites use incorrect encoding + // ref: https://hsivonen.fi/encoding-menu/ + if (charset === 'gb2312' || charset === 'gbk') { + charset = 'gb18030'; + } + } + + // turn raw buffers into a single utf-8 buffer + return convert(buffer, 'UTF-8', charset).toString(); } -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = undefined; - } +/** + * Detect a URLSearchParams object + * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143 + * + * @param Object obj Object to detect by type or brand + * @return String + */ +function isURLSearchParams(obj) { + // Duck-typing as a necessary condition. + if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { + return false; + } - return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); + // Brand-checking and more duck-typing as optional condition. + return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function'; } -function gather(octokit, results, iterator, mapFn) { - return iterator.next().then(result => { - if (result.done) { - return results; - } - - let earlyExit = false; +/** + * Check if `obj` is a W3C `Blob` object (which `File` inherits from) + * @param {*} obj + * @return {boolean} + */ +function isBlob(obj) { + return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); +} - function done() { - earlyExit = true; - } +/** + * Clone body given Res/Req instance + * + * @param Mixed instance Response or Request instance + * @return Mixed + */ +function clone(instance) { + let p1, p2; + let body = instance.body; - results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); + // don't allow cloning a used body + if (instance.bodyUsed) { + throw new Error('cannot clone body after it is used'); + } - if (earlyExit) { - return results; - } + // check that body is a stream and not form-data object + // note: we can't clone the form-data object without having it as a dependency + if (body instanceof Stream && typeof body.getBoundary !== 'function') { + // tee instance body + p1 = new PassThrough(); + p2 = new PassThrough(); + body.pipe(p1); + body.pipe(p2); + // set instance body to teed body and return the other teed body + instance[INTERNALS].body = p1; + body = p2; + } - return gather(octokit, results, iterator, mapFn); - }); + return body; } /** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor + * Performs the operation "extract a `Content-Type` value from |object|" as + * specified in the specification: + * https://fetch.spec.whatwg.org/#concept-bodyinit-extract + * + * This function assumes that instance.body is present. + * + * @param Mixed instance Any options.body input */ - -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; +function extractContentType(body) { + if (body === null) { + // body is null + return null; + } else if (typeof body === 'string') { + // body is string + return 'text/plain;charset=UTF-8'; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + return 'application/x-www-form-urlencoded;charset=UTF-8'; + } else if (isBlob(body)) { + // body is blob + return body.type || null; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return null; + } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + return null; + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + return null; + } else if (typeof body.getBoundary === 'function') { + // detect form data input from form-data module + return `multipart/form-data;boundary=${body.getBoundary()}`; + } else if (body instanceof Stream) { + // body is stream + // can't really do much about this + return null; + } else { + // Body constructor defaults other things to string + return 'text/plain;charset=UTF-8'; + } } -paginateRest.VERSION = VERSION; - -exports.paginateRest = paginateRest; -//# sourceMappingURL=index.js.map - -/***/ }), +/** + * The Fetch Standard treats this as if "total bytes" is a property on the body. + * For us, we have to explicitly get it with a function. + * + * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes + * + * @param Body instance Instance of Body + * @return Number? Number of bytes, or null if not possible + */ +function getTotalBytes(instance) { + const body = instance.body; -/***/ 323: -/***/ (function(module) { -"use strict"; + if (body === null) { + // body is null + return 0; + } else if (isBlob(body)) { + return body.size; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return body.length; + } else if (body && typeof body.getLengthSync === 'function') { + // detect form data input from form-data module + if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x + body.hasKnownLength && body.hasKnownLength()) { + // 2.x + return body.getLengthSync(); + } + return null; + } else { + // body is stream + return null; + } +} +/** + * Write a Body to a Node.js WritableStream (e.g. http.Request) object. + * + * @param Body instance Instance of Body + * @return Void + */ +function writeToStream(dest, instance) { + const body = instance.body; -var isStream = module.exports = function (stream) { - return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; -}; -isStream.writable = function (stream) { - return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; -}; + if (body === null) { + // body is null + dest.end(); + } else if (isBlob(body)) { + body.stream().pipe(dest); + } else if (Buffer.isBuffer(body)) { + // body is buffer + dest.write(body); + dest.end(); + } else { + // body is stream + body.pipe(dest); + } +} -isStream.readable = function (stream) { - return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; -}; +// expose Promise +Body.Promise = global.Promise; -isStream.duplex = function (stream) { - return isStream.writable(stream) && isStream.readable(stream); -}; +/** + * headers.js + * + * Headers class offers convenient helpers + */ -isStream.transform = function (stream) { - return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; -}; +const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; +function validateName(name) { + name = `${name}`; + if (invalidTokenRegex.test(name) || name === '') { + throw new TypeError(`${name} is not a legal HTTP header name`); + } +} -/***/ }), +function validateValue(value) { + value = `${value}`; + if (invalidHeaderCharRegex.test(value)) { + throw new TypeError(`${value} is not a legal HTTP header value`); + } +} -/***/ 336: -/***/ (function(module, __unusedexports, __webpack_require__) { +/** + * Find the key in the map object given a header name. + * + * Returns undefined if not found. + * + * @param String name Header name + * @return String|Undefined + */ +function find(map, name) { + name = name.toLowerCase(); + for (const key in map) { + if (key.toLowerCase() === name) { + return key; + } + } + return undefined; +} -module.exports = hasLastPage +const MAP = Symbol('map'); +class Headers { + /** + * Headers class + * + * @param Object headers Response headers + * @return Void + */ + constructor() { + let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) + this[MAP] = Object.create(null); -function hasLastPage (link) { - deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`) - return getPageLinks(link).last -} + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } -/***/ }), + return; + } -/***/ 348: -/***/ (function(module, __unusedexports, __webpack_require__) { + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } -"use strict"; + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } -module.exports = validate; + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } -const { RequestError } = __webpack_require__(497); -const get = __webpack_require__(854); -const set = __webpack_require__(883); + return this[MAP][key].join(', '); + } -function validate(octokit, options) { - if (!options.request.validate) { - return; - } - const { validate: params } = options.request; - - Object.keys(params).forEach(parameterName => { - const parameter = get(params, parameterName); - - const expectedType = parameter.type; - let parentParameterName; - let parentValue; - let parentParamIsPresent = true; - let parentParameterIsArray = false; - - if (/\./.test(parameterName)) { - parentParameterName = parameterName.replace(/\.[^.]+$/, ""); - parentParameterIsArray = parentParameterName.slice(-2) === "[]"; - if (parentParameterIsArray) { - parentParameterName = parentParameterName.slice(0, -2); - } - parentValue = get(options, parentParameterName); - parentParamIsPresent = - parentParameterName === "headers" || - (typeof parentValue === "object" && parentValue !== null); - } + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - const values = parentParameterIsArray - ? (get(options, parentParameterName) || []).map( - value => value[parameterName.split(/\./).pop()] - ) - : [get(options, parameterName)]; + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; - values.forEach((value, i) => { - const valueIsPresent = typeof value !== "undefined"; - const valueIsNull = value === null; - const currentParameterName = parentParameterIsArray - ? parameterName.replace(/\[\]/, `[${i}]`) - : parameterName; + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } - if (!parameter.required && !valueIsPresent) { - return; - } + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } - // if the parent parameter is of type object but allows null - // then the child parameters can be ignored - if (!parentParamIsPresent) { - return; - } + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } - if (parameter.allowNull && valueIsNull) { - return; - } + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } - if (!parameter.allowNull && valueIsNull) { - throw new RequestError( - `'${currentParameterName}' cannot be null`, - 400, - { - request: options - } - ); - } + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } - if (parameter.required && !valueIsPresent) { - throw new RequestError( - `Empty value for parameter '${currentParameterName}': ${JSON.stringify( - value - )}`, - 400, - { - request: options - } - ); - } + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } - // parse to integer before checking for enum - // so that string "1" will match enum with number 1 - if (expectedType === "integer") { - const unparsedValue = value; - value = parseInt(value, 10); - if (isNaN(value)) { - throw new RequestError( - `Invalid value for parameter '${currentParameterName}': ${JSON.stringify( - unparsedValue - )} is NaN`, - 400, - { - request: options - } - ); - } - } + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } - if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) { - throw new RequestError( - `Invalid value for parameter '${currentParameterName}': ${JSON.stringify( - value - )}`, - 400, - { - request: options - } - ); - } + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } - if (parameter.validation) { - const regex = new RegExp(parameter.validation); - if (!regex.test(value)) { - throw new RequestError( - `Invalid value for parameter '${currentParameterName}': ${JSON.stringify( - value - )}`, - 400, - { - request: options - } - ); - } - } + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - if (expectedType === "object" && typeof value === "string") { - try { - value = JSON.parse(value); - } catch (exception) { - throw new RequestError( - `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify( - value - )}`, - 400, - { - request: options - } - ); - } - } +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); - set(options, parameter.mapTo || currentParameterName, value); - }); - }); +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); - return options; -} +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} -/***/ }), +const INTERNAL = Symbol('internal'); -/***/ 349: -/***/ (function(module, __unusedexports, __webpack_require__) { +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} -module.exports = authenticationRequestError; +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } -const { RequestError } = __webpack_require__(497); + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; -function authenticationRequestError(state, error, options) { - /* istanbul ignore next */ - if (!error.headers) throw error; + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } - const otpRequired = /required/.test(error.headers["x-github-otp"] || ""); - // handle "2FA required" error only - if (error.status !== 401 || !otpRequired) { - throw error; - } + this[INTERNAL].index = index + 1; - if ( - error.status === 401 && - otpRequired && - error.request && - error.request.headers["x-github-otp"] - ) { - throw new RequestError( - "Invalid one-time password for two-factor authentication", - 401, - { - headers: error.headers, - request: options - } - ); - } + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - if (typeof state.auth.on2fa !== "function") { - throw new RequestError( - "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication", - 401, - { - headers: error.headers, - request: options - } - ); - } +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); - return Promise.resolve() - .then(() => { - return state.auth.on2fa(); - }) - .then(oneTimePassword => { - const newOptions = Object.assign(options, { - headers: Object.assign( - { "x-github-otp": oneTimePassword }, - options.headers - ) - }); - return state.octokit.request(newOptions); - }); -} +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } -/***/ }), + return obj; +} -/***/ 357: -/***/ (function(module) { +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} -module.exports = require("assert"); +const INTERNALS$1 = Symbol('Response internals'); -/***/ }), +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; -/***/ 363: -/***/ (function(module) { +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; -module.exports = register + Body.call(this, body, opts); -function register (state, name, method, options) { - if (typeof method !== 'function') { - throw new Error('method for before hook must be a function') - } + const status = opts.status || 200; + const headers = new Headers(opts.headers); - if (!options) { - options = {} - } + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options) - }, method)() - } + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } - return Promise.resolve() - .then(function () { - if (!state.registry[name]) { - return method(options) - } + get url() { + return this[INTERNALS$1].url || ''; + } - return (state.registry[name]).reduce(function (method, registered) { - return registered.hook.bind(null, method, options) - }, method)() - }) -} + get status() { + return this[INTERNALS$1].status; + } + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } -/***/ }), + get redirected() { + return this[INTERNALS$1].counter > 0; + } -/***/ 368: -/***/ (function(module) { + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } -module.exports = function atob(str) { - return Buffer.from(str, 'base64').toString('binary') + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } } +Body.mixIn(Response.prototype); -/***/ }), +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); -/***/ 370: -/***/ (function(module) { +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); -module.exports = deprecate +const INTERNALS$2 = Symbol('Request internals'); -const loggedMessages = {} +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; -function deprecate (message) { - if (loggedMessages[message]) { - return - } +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - console.warn(`DEPRECATED (@octokit/rest): ${message}`) - loggedMessages[message] = 1 +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; } +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} -/***/ }), +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; -/***/ 385: -/***/ (function(__unusedmodule, exports, __webpack_require__) { + let parsedURL; -"use strict"; + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parse_url(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parse_url(`${input}`); + } + input = {}; + } else { + parsedURL = parse_url(input.url); + } + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); -Object.defineProperty(exports, '__esModule', { value: true }); + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; -var isPlainObject = _interopDefault(__webpack_require__(696)); -var universalUserAgent = __webpack_require__(562); + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); -function lowercaseKeys(object) { - if (!object) { - return {}; - } + const headers = new Headers(init.headers || input.headers || {}); - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach(key => { - if (isPlainObject(options[key])) { - if (!(key in defaults)) Object.assign(result, { - [key]: options[key] - });else result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { - [key]: options[key] - }); - } - }); - return result; -} + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { - method, - url - } : { - url: method - }, options); - } else { - options = Object.assign({}, route); - } // lowercase header names before merging with defaults to avoid duplicates + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; - options.headers = lowercaseKeys(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } - if (defaults && defaults.mediaType.previews.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); - } + get method() { + return this[INTERNALS$2].method; + } - mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); - return mergedOptions; -} + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); + get headers() { + return this[INTERNALS$2].headers; + } - if (names.length === 0) { - return url; - } + get redirect() { + return this[INTERNALS$2].redirect; + } - return url + separator + names.map(name => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } + get signal() { + return this[INTERNALS$2].signal; + } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } } -const urlVariableRegex = /\{[^}]+\}/g; - -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); -} +Body.mixIn(Request.prototype); -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); - if (!matches) { - return []; - } +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); -function omit(object, keysToOmit) { - return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { - obj[key] = object[key]; - return obj; - }, {}); -} + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } -// Based on https://github.com/bramstein/url-template, licensed under BSD -// TODO: create separate package. -// -// Copyright (c) 2012-2014, Bram Stein -// All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } -/* istanbul ignore file */ -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } - return part; - }).join(""); -} + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } -function isDefined(value) { - return value !== undefined && value !== null; -} + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} + if (!headers.has('Connection') && !agent) { + headers.set('Connection', 'close'); + } -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - tmp.push(encodeValue(operator, value)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } - - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); - } - } +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); - return result; -} + this.type = 'aborted'; + this.message = message; -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); } -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; +const resolve_url = Url.resolve; - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { - if (operator && operator !== "+") { - var separator = ","; + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } + Body.Promise = fetch.Promise; - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } - }); -} + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); -function parse(options) { - // https://fetch.spec.whatwg.org/#methods - let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later + let response = null; - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + request.body.destroy(error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } + if (signal && signal.aborted) { + abort(); + return; + } - const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequset = /application\/octet-stream/i.test(headers.accept); + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; - if (!isBinaryRequset) { - if (options.mediaType.format) { - // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw - headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); - } + // send request + const req = send(options); + let reqTimeout; - if (options.mediaType.previews.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } // for GET/HEAD requests, set URL query parameters from remaining parameters - // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } else { - headers["content-length"] = 0; - } - } - } // default content-type for JSON if body is set + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + finalize(); + }); - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. - // fetch does not allow to set `content-length` header, but we can set body to an empty string + req.on('response', function (res) { + clearTimeout(reqTimeout); + const headers = createHeadersLenient(res.headers); - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } // Only return body/request keys if present + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); + // HTTP fetch step 5.3 + const locationURL = location === null ? null : resolve_url(request.url, location); - return Object.assign({ - method, - url, - headers - }, typeof body !== "undefined" ? { - body - } : null, options.request ? { - request: options.request - } : null); -} + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); -} - -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS = merge(oldDefaults, newDefaults); - const endpoint = endpointWithDefaults.bind(null, DEFAULTS); - return Object.assign(endpoint, { - DEFAULTS, - defaults: withDefaults.bind(null, DEFAULTS), - merge: merge.bind(null, DEFAULTS), - parse - }); -} - -const VERSION = "6.0.1"; + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } -const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. -// So we use RequestParameters and add method as additional required property. + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout + }; -const DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "", - previews: [] - } -}; + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } -const endpoint = withDefaults(null, DEFAULTS); + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } -exports.endpoint = endpoint; -//# sourceMappingURL=index.js.map + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); -/***/ }), + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; -/***/ 389: -/***/ (function(module, __unusedexports, __webpack_require__) { + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); -"use strict"; + // HTTP-network fetch step 12.1.1.4: handle content codings + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } -const fs = __webpack_require__(747); -const shebangCommand = __webpack_require__(866); + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - let buffer; + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } - 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 - } + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + return; + } - let fd; + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); + writeToStream(req, request); + }); } +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; -module.exports = readShebang; - +// expose Promise +fetch.Promise = global.Promise; -/***/ }), +module.exports = exports = fetch; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = exports; +exports.Headers = Headers; +exports.Request = Request; +exports.Response = Response; +exports.FetchError = FetchError; -/***/ 402: -/***/ (function(module, __unusedexports, __webpack_require__) { -module.exports = Octokit; +/***/ }), -const { request } = __webpack_require__(753); -const Hook = __webpack_require__(523); +/***/ 463: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -const parseClientOptions = __webpack_require__(294); +"use strict"; -function Octokit(plugins, options) { - options = options || {}; - const hook = new Hook.Collection(); - const log = Object.assign( - { - debug: () => {}, - info: () => {}, - warn: console.warn, - error: console.error - }, - options && options.log - ); - const api = { - hook, - log, - request: request.defaults(parseClientOptions(options, log, hook)) - }; - plugins.forEach(pluginFunction => pluginFunction(api, options)); +Object.defineProperty(exports, '__esModule', { value: true }); - return api; -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } +var deprecation = __webpack_require__(692); +var once = _interopDefault(__webpack_require__(969)); -/***/ }), +const logOnce = once(deprecation => console.warn(deprecation)); +/** + * Error with extra properties to help with debugging + */ -/***/ 413: -/***/ (function(module) { +class RequestError extends Error { + constructor(message, statusCode, options) { + super(message); // Maintains proper stack trace (only available on V8) -module.exports = require("stream"); + /* istanbul ignore next */ -/***/ }), + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } -/***/ 415: -/***/ (function(module, __unusedexports, __webpack_require__) { + this.name = "HttpError"; + this.status = statusCode; + Object.defineProperty(this, "code", { + get() { + logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + } -const { inspect } = __webpack_require__(669); -var fs = __webpack_require__(747); -const core = __webpack_require__(470); + }); + this.headers = options.headers || {}; // redact request credentials without mutating original request options -const MAX_ARGS = 50; -const namedArgPattern = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/; + const requestCopy = Object.assign({}, options.request); -const commandDefaults = Object.freeze({ - permission: "write", - issue_type: "both", - allow_edits: false, - repository: process.env.GITHUB_REPOSITORY, - event_type_suffix: "-command", - named_args: false -}); + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + }); + } -function toBool(input, defaultVal) { - if (typeof input === 'boolean') { - return input; - } else if (typeof input === 'undefined' || input.length == 0) { - return defaultVal; - } else { - return input === "true"; + requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit + // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications + .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended + // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header + .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; } -} -function getInputs() { - return { - token: core.getInput("token"), - reactionToken: core.getInput("reaction-token"), - reactions: toBool(core.getInput("reactions"), true), - commands: core.getInput("commands"), - permission: core.getInput("permission"), - issueType: core.getInput("issue-type"), - allowEdits: core.getInput("allow-edits"), - repository: core.getInput("repository"), - eventTypeSuffix: core.getInput("event-type-suffix"), - namedArgs: core.getInput("named-args"), - config: core.getInput("config"), - configFromFile: core.getInput("config-from-file") - }; } -function getCommandsConfig(inputs) { - if (inputs.configFromFile) { - core.info(`Using JSON configuration from file '${inputs.configFromFile}'.`); - return getCommandsConfigFromJson(fs.readFileSync(inputs.configFromFile)); - } else if (inputs.config) { - core.info(`Using JSON configuration from 'config' input.`); - return getCommandsConfigFromJson(inputs.config); - } else { - core.info(`Using configuration from yaml inputs.`); - return getCommandsConfigFromInputs(inputs); - } -} +exports.RequestError = RequestError; +//# sourceMappingURL=index.js.map -function extend(obj1, obj2) { - var result = {}; - for (val in obj1) result[val] = obj1[val]; - for (val in obj2) result[val] = obj2[val]; - return result; -} -function getCommandsConfigFromInputs(inputs) { - // Get commands - const commands = inputs.commands.replace(/\s+/g, "").split(","); - core.debug(`Commands: ${inspect(commands)}`); - - // Build config - var config = []; - for (const c of commands) { - var cmd = {}; - cmd.command = c; - cmd = extend(commandDefaults, cmd); - cmd.permission = inputs.permission ? inputs.permission : cmd.permission; - cmd.issue_type = inputs.issueType ? inputs.issueType : cmd.issue_type; - cmd.allow_edits = toBool(inputs.allowEdits, cmd.allow_edits); - cmd.repository = inputs.repository ? inputs.repository : cmd.repository; - cmd.event_type_suffix = inputs.eventTypeSuffix - ? inputs.eventTypeSuffix - : cmd.event_type_suffix; - cmd.named_args = toBool(inputs.namedArgs, cmd.named_args); - config.push(cmd); - } - return config; -} +/***/ }), -function getCommandsConfigFromJson(json) { - const jsonConfig = JSON.parse(json); - core.debug(`JSON config: ${inspect(jsonConfig)}`); - - var config = []; - for (const jc of jsonConfig) { - var cmd = {}; - cmd.command = jc.command; - cmd = extend(commandDefaults, cmd); - cmd.permission = jc.permission ? jc.permission : cmd.permission; - cmd.issue_type = jc.issue_type ? jc.issue_type : cmd.issue_type; - cmd.allow_edits = toBool(jc.allow_edits, cmd.allow_edits); - cmd.repository = jc.repository ? jc.repository : cmd.repository; - cmd.event_type_suffix = jc.event_type_suffix - ? jc.event_type_suffix - : cmd.event_type_suffix; - cmd.named_args = toBool(jc.named_args, cmd.named_args); - config.push(cmd); - } - return config; -} - -function configIsValid(config) { - for (const command of config) { - if (!["none", "read", "write", "admin"].includes(command.permission)) { - core.setFailed(`'${command.permission}' is not a valid 'permission'.`); - return false; - } - if (!["issue", "pull-request", "both"].includes(command.issue_type)) { - core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`); - return false; - } - } - return true; -} - -function actorHasPermission(actorPermission, commandPermission) { - const permissionLevels = Object.freeze({ - none: 1, - read: 2, - write: 3, - admin: 4 - }); - core.debug(`Actor permission level: ${permissionLevels[actorPermission]}`); - core.debug( - `Command permission level: ${permissionLevels[commandPermission]}` - ); - return ( - permissionLevels[actorPermission] >= permissionLevels[commandPermission] - ); -} - -async function getActorPermission(octokit, repo, actor) { - const { - data: { permission } - } = await octokit.repos.getCollaboratorPermissionLevel({ - ...repo, - username: actor - }); - return permission; -} - -async function addReaction(octokit, repo, commentId, reaction) { - try { - await octokit.reactions.createForIssueComment({ - ...repo, - comment_id: commentId, - content: reaction - }); - } catch (error) { - core.debug(inspect(error)); - core.warning(`Failed to set reaction on comment ID ${commentId}.`); - } -} - -function getSlashCommandPayload(commandWords, namedArgs) { - var payload = { - command: commandWords[0], - args: "" - }; - if (commandWords.length > 1) { - const argWords = commandWords.slice(1, MAX_ARGS + 1); - payload.args = argWords.join(" "); - // Parse named and unnamed args - var unnamedCount = 1; - var unnamedArgs = []; - for (var argWord of argWords) { - if (namedArgs && namedArgPattern.test(argWord)) { - const { groups: { name, value } } = namedArgPattern.exec(argWord); - payload[`${name}`] = value; - } else { - unnamedArgs.push(argWord) - payload[`arg${unnamedCount}`] = argWord; - unnamedCount += 1; - } - } - // Add a string of only the unnamed args - if (namedArgs && unnamedArgs.length > 0) { - payload["unnamed_args"] = unnamedArgs.join(" "); - } - } - return payload; -} - -module.exports = { - MAX_ARGS, - commandDefaults, - getInputs, - getCommandsConfig, - getCommandsConfigFromInputs, - getCommandsConfigFromJson, - configIsValid, - actorHasPermission, - getActorPermission, - addReaction, - getSlashCommandPayload -}; - - -/***/ }), - -/***/ 427: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 469: +/***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; -// Older verions of Node.js might not have `util.getSystemErrorName()`. -// In that case, fall back to a deprecated internal. -const util = __webpack_require__(669); - -let uv; - -if (typeof util.getSystemErrorName === 'function') { - module.exports = util.getSystemErrorName; -} else { - try { - uv = process.binding('uv'); - - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } - } catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; - } - - module.exports = code => errname(uv, code); -} - -// Used for testing the fallback behavior -module.exports.__test__ = errname; - -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } - - if (!(code < 0)) { - throw new Error('err >= 0'); - } - - return `Unknown system error ${code}`; -} - - - -/***/ }), - -/***/ 430: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = octokitValidate; - -const validate = __webpack_require__(348); - -function octokitValidate(octokit) { - octokit.hook.before("request", validate.bind(null, octokit)); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOctokit = exports.context = void 0; +const Context = __importStar(__webpack_require__(262)); +const utils_1 = __webpack_require__(521); +exports.context = new Context.Context(); +/** + * Returns a hydrated octokit ready to use for GitHub Actions + * + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set + */ +function getOctokit(token, options) { + return new utils_1.GitHub(utils_1.getOctokitOptions(token, options)); } - +exports.getOctokit = getOctokit; +//# sourceMappingURL=github.js.map /***/ }), -/***/ 431: +/***/ 470: /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; @@ -5221,19805 +4559,4678 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); +const command_1 = __webpack_require__(431); const os = __importStar(__webpack_require__(87)); +const path = __importStar(__webpack_require__(622)); /** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value + * The code to exit an action */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = command_1.toCommandValue(val); + process.env[name] = convertedVal; + command_1.issueCommand('set-env', { name }, convertedVal); } -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); } -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + command_1.issueCommand('add-path', {}, inputPath); + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } +exports.addPath = addPath; /** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string + * Gets the value of an input. The value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); } - return JSON.stringify(input); + return val.trim(); } -exports.toCommandValue = toCommandValue; -function escapeData(s) { - return toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); +exports.getInput = getInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + command_1.issueCommand('set-output', { name }, value); } -function escapeProperty(s) { - return toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A') - .replace(/:/g, '%3A') - .replace(/,/g, '%2C'); +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); } -//# sourceMappingURL=command.js.map - -/***/ }), - -/***/ 453: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var once = __webpack_require__(969) -var eos = __webpack_require__(9) -var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes - -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); } - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; } - -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +function error(message) { + command_1.issue('error', message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +function warning(message) { + command_1.issue('warning', message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; } +exports.getState = getState; +//# sourceMappingURL=core.js.map -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) +/***/ }), - var closed = false - stream.on('close', function () { - closed = true - }) +/***/ 473: +/***/ (function(module) { - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) +"use strict"; - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true +module.exports = /^#!.*/; - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - if (isFn(stream.destroy)) return stream.destroy() +/***/ }), - callback(err || new Error('stream was destroyed')) - } -} +/***/ 510: +/***/ (function(module) { -var call = function (fn) { - fn() -} +module.exports = addHook -var pipe = function (from, to) { - return from.pipe(to) -} +function addHook (state, kind, name, hook) { + var orig = hook + if (!state.registry[name]) { + state.registry[name] = [] + } -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + if (kind === 'before') { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)) + } + } - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') + if (kind === 'after') { + hook = function (method, options) { + var result + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_ + return orig(result, options) + }) + .then(function () { + return result + }) + } + } - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) + if (kind === 'error') { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options) + }) + } + } - return streams.reduce(pipe) + state.registry[name].push({ + hook: hook, + orig: orig + }) } -module.exports = pump - /***/ }), -/***/ 454: -/***/ (function(module, exports, __webpack_require__) { +/***/ 521: +/***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOctokitOptions = exports.GitHub = exports.context = void 0; +const Context = __importStar(__webpack_require__(262)); +const Utils = __importStar(__webpack_require__(127)); +// octokit + plugins +const core_1 = __webpack_require__(448); +const plugin_rest_endpoint_methods_1 = __webpack_require__(842); +const plugin_paginate_rest_1 = __webpack_require__(299); +exports.context = new Context.Context(); +const baseUrl = Utils.getApiBaseUrl(); +const defaults = { + baseUrl, + request: { + agent: Utils.getProxyAgent(baseUrl) + } +}; +exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults); +/** + * Convience function to correctly format Octokit Options to pass into the constructor. + * + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set + */ +function getOctokitOptions(token, options) { + const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller + // Auth + const auth = Utils.getAuthString(token, opts); + if (auth) { + opts.auth = auth; + } + return opts; +} +exports.getOctokitOptions = getOctokitOptions; +//# sourceMappingURL=utils.js.map -Object.defineProperty(exports, '__esModule', { value: true }); +/***/ }), -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(__webpack_require__(413)); -var http = _interopDefault(__webpack_require__(605)); -var Url = _interopDefault(__webpack_require__(835)); -var https = _interopDefault(__webpack_require__(34)); -var zlib = _interopDefault(__webpack_require__(761)); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } +/***/ 523: +/***/ (function(module, __unusedexports, __webpack_require__) { - this[BUFFER] = Buffer.concat(buffers); +var register = __webpack_require__(280) +var addHook = __webpack_require__(510) +var removeHook = __webpack_require__(866) - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } + ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind] + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) + }) } -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; +function HookSingular () { + var singularHookName = 'h' + var singularHookState = { + registry: {} } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); + var singularHook = register.bind(null, singularHookState, singularHookName) + bindApi(singularHook, singularHookState, singularHookName) + return singularHook } -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = __webpack_require__(18).convert; -} catch (e) {} +function HookCollection () { + var state = { + registry: {} + } -const INTERNALS = Symbol('Body internals'); + var hook = register.bind(null, state) + bindApi(hook, state) -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; + return hook +} -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; +var collectionHookDeprecationMessageDisplayed = false +function Hook () { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') + collectionHookDeprecationMessageDisplayed = true + } + return HookCollection() +} - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; +module.exports = Hook +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook +module.exports.Singular = Hook.Singular +module.exports.Collection = Hook.Collection - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} +/***/ }), -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, +/***/ 539: +/***/ (function(__unusedmodule, exports, __webpack_require__) { - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const url = __webpack_require__(835); +const http = __webpack_require__(605); +const https = __webpack_require__(211); +const pm = __webpack_require__(950); +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); /** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); +function getProxyUrl(serverUrl) { + let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; } - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }); + } } - -/** - * Write a Body to a Node.js WritableStream (e.g. http.Request) object. - * - * @param Body instance Instance of Body - * @return Void - */ -function writeToStream(dest, instance) { - const body = instance.body; - - - if (body === null) { - // body is null - dest.end(); - } else if (isBlob(body)) { - body.stream().pipe(dest); - } else if (Buffer.isBuffer(body)) { - // body is buffer - dest.write(body); - dest.end(); - } else { - // body is stream - body.pipe(dest); - } +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = url.parse(requestUrl); + return parsedUrl.protocol === 'https:'; } - -// expose Promise -Body.Promise = global.Promise; - -/** - * headers.js - * - * Headers class offers convenient helpers - */ - -const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; -const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - -function validateName(name) { - name = `${name}`; - if (invalidTokenRegex.test(name) || name === '') { - throw new TypeError(`${name} is not a legal HTTP header name`); - } -} - -function validateValue(value) { - value = `${value}`; - if (invalidHeaderCharRegex.test(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`); - } -} - -/** - * Find the key in the map object given a header name. - * - * Returns undefined if not found. - * - * @param String name Header name - * @return String|Undefined - */ -function find(map, name) { - name = name.toLowerCase(); - for (const key in map) { - if (key.toLowerCase() === name) { - return key; - } - } - return undefined; -} - -const MAP = Symbol('map'); -class Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); - } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; - - -/***/ }), - -/***/ 462: -/***/ (function(module) { - -"use strict"; - - -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/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: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var deprecation = __webpack_require__(692); -var once = _interopDefault(__webpack_require__(969)); - -const logOnce = once(deprecation => console.warn(deprecation)); -/** - * Error with extra properties to help with debugging - */ - -class RequestError extends Error { - constructor(message, statusCode, options) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = "HttpError"; - this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } - - }); - this.headers = options.headers || {}; // redact request credentials without mutating original request options - - const requestCopy = Object.assign({}, options.request); - - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); - } - - requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit - // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications - .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended - // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header - .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; - } - -} - -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 469: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -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 }); -// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts -const graphql_1 = __webpack_require__(898); -const rest_1 = __webpack_require__(0); -const Context = __importStar(__webpack_require__(262)); -const httpClient = __importStar(__webpack_require__(539)); -// We need this in order to extend Octokit -rest_1.Octokit.prototype = new rest_1.Octokit(); -exports.context = new Context.Context(); -class GitHub extends rest_1.Octokit { - constructor(token, opts) { - super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts))); - this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts)); - } - /** - * Disambiguates the constructor overload parameters - */ - static disambiguate(token, opts) { - return [ - typeof token === 'string' ? token : '', - typeof token === 'object' ? token : opts || {} - ]; - } - static getOctokitOptions(args) { - const token = args[0]; - const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller - // Auth - const auth = GitHub.getAuthString(token, options); - if (auth) { - options.auth = auth; - } - // Proxy - const agent = GitHub.getProxyAgent(options); - if (agent) { - // Shallow clone - don't mutate the object provided by the caller - options.request = options.request ? Object.assign({}, options.request) : {}; - // Set the agent - options.request.agent = agent; - } - return options; - } - static getGraphQL(args) { - const defaults = {}; - const token = args[0]; - const options = args[1]; - // Authorization - const auth = this.getAuthString(token, options); - if (auth) { - defaults.headers = { - authorization: auth - }; - } - // Proxy - const agent = GitHub.getProxyAgent(options); - if (agent) { - defaults.request = { agent }; - } - return graphql_1.graphql.defaults(defaults); - } - static getAuthString(token, options) { - // Validate args - if (!token && !options.auth) { - throw new Error('Parameter token or opts.auth is required'); - } - else if (token && options.auth) { - throw new Error('Parameters token and opts.auth may not both be specified'); - } - return typeof options.auth === 'string' ? options.auth : `token ${token}`; - } - static getProxyAgent(options) { - var _a; - if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) { - const serverUrl = 'https://api.github.com'; - if (httpClient.getProxyUrl(serverUrl)) { - const hc = new httpClient.HttpClient(); - return hc.getAgent(serverUrl); - } - } - return undefined; - } -} -exports.GitHub = GitHub; -//# sourceMappingURL=github.js.map - -/***/ }), - -/***/ 470: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -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 }); -const command_1 = __webpack_require__(431); -const os = __importStar(__webpack_require__(87)); -const path = __importStar(__webpack_require__(622)); -/** - * The code to exit an action - */ -var ExitCode; -(function (ExitCode) { - /** - * A code indicating that the action was successful - */ - ExitCode[ExitCode["Success"] = 0] = "Success"; - /** - * A code indicating that the action was a failure - */ - ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); -//----------------------------------------------------------------------- -// Variables -//----------------------------------------------------------------------- -/** - * Sets env variable for this action and future actions in the job - * @param name the name of the variable to set - * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); - process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); -} -exports.exportVariable = exportVariable; -/** - * Registers a secret which will get masked from logs - * @param secret value of the secret - */ -function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); -} -exports.setSecret = setSecret; -/** - * Prepends inputPath to the PATH (for this action and future actions) - * @param inputPath - */ -function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); - process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; -} -exports.addPath = addPath; -/** - * Gets the value of an input. The value is also trimmed. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string - */ -function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - return val.trim(); -} -exports.getInput = getInput; -/** - * Sets the value of an output. - * - * @param name name of the output to set - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function setOutput(name, value) { - command_1.issueCommand('set-output', { name }, value); -} -exports.setOutput = setOutput; -/** - * Enables or disables the echoing of commands into stdout for the rest of the step. - * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. - * - */ -function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); -} -exports.setCommandEcho = setCommandEcho; -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- -/** - * Sets the action status to failed. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message - */ -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -exports.setFailed = setFailed; -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- -/** - * Gets whether Actions Step Debug is on or not - */ -function isDebug() { - return process.env['RUNNER_DEBUG'] === '1'; -} -exports.isDebug = isDebug; -/** - * Writes debug message to user log - * @param message debug message - */ -function debug(message) { - command_1.issueCommand('debug', {}, message); -} -exports.debug = debug; -/** - * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() - */ -function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); -} -exports.error = error; -/** - * Adds an warning issue - * @param message warning issue message. Errors will be converted to string via toString() - */ -function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); -} -exports.warning = warning; -/** - * Writes info to log with console.log. - * @param message info message - */ -function info(message) { - process.stdout.write(message + os.EOL); -} -exports.info = info; -/** - * Begin an output group. - * - * Output until the next `groupEnd` will be foldable in this group - * - * @param name The name of the output group - */ -function startGroup(name) { - command_1.issue('group', name); -} -exports.startGroup = startGroup; -/** - * End an output group. - */ -function endGroup() { - command_1.issue('endgroup'); -} -exports.endGroup = endGroup; -/** - * Wrap an asynchronous function call in a group. - * - * Returns the same type as the function itself. - * - * @param name The name of the group - * @param fn The function to wrap in the group - */ -function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } - finally { - endGroup(); - } - return result; - }); -} -exports.group = group; -//----------------------------------------------------------------------- -// Wrapper action state -//----------------------------------------------------------------------- -/** - * Saves state for current action, the state can only be retrieved by this action's post job execution. - * - * @param name name of the state to store - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); -} -exports.saveState = saveState; -/** - * Gets the value of an state set by this action's main execution. - * - * @param name name of the state to get - * @returns string - */ -function getState(name) { - return process.env[`STATE_${name}`] || ''; -} -exports.getState = getState; -//# sourceMappingURL=core.js.map - -/***/ }), - -/***/ 471: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = authenticationBeforeRequest; - -const btoa = __webpack_require__(675); -const uniq = __webpack_require__(126); - -function authenticationBeforeRequest(state, options) { - if (!state.auth.type) { - return; - } - - if (state.auth.type === "basic") { - const hash = btoa(`${state.auth.username}:${state.auth.password}`); - options.headers.authorization = `Basic ${hash}`; - return; - } - - if (state.auth.type === "token") { - options.headers.authorization = `token ${state.auth.token}`; - return; - } - - if (state.auth.type === "app") { - options.headers.authorization = `Bearer ${state.auth.token}`; - const acceptHeaders = options.headers.accept - .split(",") - .concat("application/vnd.github.machine-man-preview+json"); - options.headers.accept = uniq(acceptHeaders) - .filter(Boolean) - .join(","); - return; - } - - options.url += options.url.indexOf("?") === -1 ? "?" : "&"; - - if (state.auth.token) { - options.url += `access_token=${encodeURIComponent(state.auth.token)}`; - return; - } - - const key = encodeURIComponent(state.auth.key); - const secret = encodeURIComponent(state.auth.secret); - options.url += `client_id=${key}&client_secret=${secret}`; -} - - -/***/ }), - -/***/ 489: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -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 */ - } - } - - 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; - - -/***/ }), - -/***/ 497: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var deprecation = __webpack_require__(692); -var once = _interopDefault(__webpack_require__(969)); - -const logOnce = once(deprecation => console.warn(deprecation)); -/** - * Error with extra properties to help with debugging - */ - -class RequestError extends Error { - constructor(message, statusCode, options) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = "HttpError"; - this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } - - }); - this.headers = options.headers || {}; // redact request credentials without mutating original request options - - const requestCopy = Object.assign({}, options.request); - - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); - } - - requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit - // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications - .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended - // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header - .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; - } - -} - -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 510: -/***/ (function(module) { - -module.exports = addHook - -function addHook (state, kind, name, hook) { - var orig = hook - if (!state.registry[name]) { - state.registry[name] = [] - } - - if (kind === 'before') { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)) - } - } - - if (kind === 'after') { - hook = function (method, options) { - var result - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_ - return orig(result, options) - }) - .then(function () { - return result - }) - } - } - - if (kind === 'error') { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options) - }) - } - } - - state.registry[name].push({ - hook: hook, - orig: orig - }) -} - - -/***/ }), - -/***/ 523: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var register = __webpack_require__(363) -var addHook = __webpack_require__(510) -var removeHook = __webpack_require__(763) - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} - -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} - -function HookCollection () { - var state = { - registry: {} - } - - var hook = register.bind(null, state) - bindApi(hook, state) - - return hook -} - -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} - -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() - -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection - - -/***/ }), - -/***/ 529: -/***/ (function(module, __unusedexports, __webpack_require__) { - -const factory = __webpack_require__(47); - -module.exports = factory(); - - -/***/ }), - -/***/ 536: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = hasFirstPage - -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) - -function hasFirstPage (link) { - deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`) - return getPageLinks(link).first -} - - -/***/ }), - -/***/ 539: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const url = __webpack_require__(835); -const http = __webpack_require__(605); -const https = __webpack_require__(34); -const pm = __webpack_require__(950); -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ -function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; -} -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return new Promise(async (resolve, reject) => { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - }); - } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = url.parse(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - async getJson(requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - let res = await this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async postJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async putJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async patchJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - async request(verb, requestUrl, data, headers) { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - let parsedUrl = url.parse(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - response = await this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - let parsedRedirectUrl = url.parse(redirectUrl); - if (parsedUrl.protocol == 'https:' && - parsedUrl.protocol != parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - await response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (let header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = await this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - await response.readBody(); - await this._performExponentialBackoff(numTries); - } - } - return response; - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); - } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof data === 'string') { - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); - } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); - }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - let parsedUrl = url.parse(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - this.handlers.forEach(handler => { - handler.prepareRequest(info.options); - }); - } - return info; - } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - let proxyUrl = pm.getProxyUrl(parsedUrl); - let useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __webpack_require__(856); - } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - proxyAuth: proxyUrl.auth, - host: proxyUrl.hostname, - port: proxyUrl.port - } - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - async _processResponse(res, options) { - return new Promise(async (resolve, reject) => { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = await res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = 'Failed request: (' + statusCode + ')'; - } - let err = new Error(msg); - // attach statusCode and body obj (if available) to the error object - err['statusCode'] = statusCode; - if (response.result) { - err['result'] = response.result; - } - reject(err); - } - else { - resolve(response); - } - }); - } -} -exports.HttpClient = HttpClient; - - -/***/ }), - -/***/ 550: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = getNextPage - -const getPage = __webpack_require__(265) - -function getNextPage (octokit, link, headers) { - return getPage(octokit, link, 'next', headers) -} - - -/***/ }), - -/***/ 558: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = hasPreviousPage - -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) - -function hasPreviousPage (link) { - deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`) - return getPageLinks(link).prev -} - - -/***/ }), - -/***/ 562: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var osName = _interopDefault(__webpack_require__(2)); - -function getUserAgent() { - try { - return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`; - } catch (error) { - if (/wmic os get Caption/.test(error.message)) { - return "Windows "; - } - - return ""; - } -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 563: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = getPreviousPage - -const getPage = __webpack_require__(265) - -function getPreviousPage (octokit, link, headers) { - return getPage(octokit, link, 'prev', headers) -} - - -/***/ }), - -/***/ 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: -/***/ (function(module) { - -module.exports = getPageLinks - -function getPageLinks (link) { - link = link.link || link.headers.link || '' - - const links = {} - - // link format: - // '; rel="next", ; rel="last"' - link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => { - links[type] = uri - }) - - return links -} - - -/***/ }), - -/***/ 605: -/***/ (function(module) { - -module.exports = require("http"); - -/***/ }), - -/***/ 614: -/***/ (function(module) { - -module.exports = require("events"); - -/***/ }), - -/***/ 621: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const path = __webpack_require__(622); -const pathKey = __webpack_require__(39); - -module.exports = opts => { - opts = Object.assign({ - cwd: process.cwd(), - path: process.env[pathKey()] - }, opts); - - let prev; - let pth = path.resolve(opts.cwd); - const ret = []; - - while (prev !== pth) { - ret.push(path.join(pth, 'node_modules/.bin')); - prev = pth; - pth = path.resolve(pth, '..'); - } - - // ensure the running `node` binary is used - ret.push(path.dirname(process.execPath)); - - return ret.concat(opts.path).join(path.delimiter); -}; - -module.exports.env = opts => { - opts = Object.assign({ - env: process.env - }, opts); - - const env = Object.assign({}, opts.env); - const path = pathKey({env}); - - opts.path = env[path]; - env[path] = module.exports(opts); - - return env; -}; - - -/***/ }), - -/***/ 622: -/***/ (function(module) { - -module.exports = require("path"); - -/***/ }), - -/***/ 631: -/***/ (function(module) { - -module.exports = require("net"); - -/***/ }), - -/***/ 649: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = getLastPage - -const getPage = __webpack_require__(265) - -function getLastPage (octokit, link, headers) { - return getPage(octokit, link, 'last', headers) -} - - -/***/ }), - -/***/ 654: -/***/ (function(module) { - -// This is not the set of all possible signals. -// -// It IS, however, the set of all signals that trigger -// an exit on either Linux or BSD systems. Linux is a -// superset of the signal names supported on BSD, and -// the unknown signals just fail to register, so we can -// catch that easily enough. -// -// Don't bother with SIGKILL. It's uncatchable, which -// means that we can't fire any callbacks anyway. -// -// If a user does happen to register a handler on a non- -// fatal signal like SIGWINCH or something, and then -// exit, it'll end up firing `process.emit('exit')`, so -// the handler will be fired anyway. -// -// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised -// artificially, inherently leave the process in a -// state from which it is not safe to try and enter JS -// listeners. -module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' -] - -if (process.platform !== 'win32') { - module.exports.push( - 'SIGVTALRM', - 'SIGXCPU', - 'SIGXFSZ', - 'SIGUSR2', - 'SIGTRAP', - 'SIGSYS', - 'SIGQUIT', - 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ) -} - -if (process.platform === 'linux') { - module.exports.push( - 'SIGIO', - 'SIGPOLL', - 'SIGPWR', - 'SIGSTKFLT', - 'SIGUNUSED' - ) -} - - -/***/ }), - -/***/ 669: -/***/ (function(module) { - -module.exports = require("util"); - -/***/ }), - -/***/ 674: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = authenticate; - -const { Deprecation } = __webpack_require__(692); -const once = __webpack_require__(969); - -const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation)); - -function authenticate(state, options) { - deprecateAuthenticate( - state.octokit.log, - new Deprecation( - '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.' - ) - ); - - if (!options) { - state.auth = false; - return; - } - - switch (options.type) { - case "basic": - if (!options.username || !options.password) { - throw new Error( - "Basic authentication requires both a username and password to be set" - ); - } - break; - - case "oauth": - if (!options.token && !(options.key && options.secret)) { - throw new Error( - "OAuth2 authentication requires a token or key & secret to be set" - ); - } - break; - - case "token": - case "app": - if (!options.token) { - throw new Error("Token authentication requires a token to be set"); - } - break; - - default: - throw new Error( - "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'" - ); - } - - state.auth = options; -} - - -/***/ }), - -/***/ 675: -/***/ (function(module) { - -module.exports = function btoa(str) { - return new Buffer(str).toString('base64') -} - - -/***/ }), - -/***/ 676: -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { - -const { inspect } = __webpack_require__(669); -const core = __webpack_require__(470); -const github = __webpack_require__(469); -const { - getInputs, - getCommandsConfig, - configIsValid, - actorHasPermission, - getActorPermission, - addReaction, - getSlashCommandPayload -} = __webpack_require__(415); - -async function run() { - try { - // Only handle 'created' and 'edited' event types - if (!["created", "edited"].includes(github.context.payload.action)) { - core.warning( - `Event type '${github.context.payload.action}' not supported.` - ); - return; - } - - // Get action inputs - const inputs = getInputs(); - core.debug(`Inputs: ${inspect(inputs)}`); - - // Check required inputs - if (!inputs.token) { - core.setFailed("Missing required input 'token'."); - return false; - } - - // Get configuration for registered commands - const config = getCommandsConfig(inputs); - core.debug(`Commands config: ${inspect(config)}`); - - // Check the config is valid - if (!configIsValid(config)) return; - - // Get the comment body and id - const commentBody = github.context.payload["comment"]["body"]; - const commentId = github.context.payload["comment"]["id"]; - core.debug(`Comment body: ${commentBody}`); - core.debug(`Comment id: ${commentId}`); - - // Check if the first line of the comment is a slash command - const firstLine = commentBody.split(/\r?\n/)[0].trim(); - if (firstLine.length < 2 || firstLine.charAt(0) != "/") { - console.debug("The first line of the comment is not a valid slash command."); - return; - } - - // Split the first line into "words" - const commandWords = firstLine.slice(1).split(" "); - core.debug(`Command words: ${inspect(commandWords)}`); - - // Check if the command is registered for dispatch - var configMatches = config.filter(function(cmd) { - return cmd.command == commandWords[0]; - }); - core.debug(`Config matches on 'command': ${inspect(configMatches)}`); - if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not registered for dispatch.`); - return; - } - - // Filter matching commands by issue type - const isPullRequest = "pull_request" in github.context.payload.issue; - configMatches = configMatches.filter(function(cmd) { - return ( - cmd.issue_type == "both" || - (cmd.issue_type == "issue" && !isPullRequest) || - (cmd.issue_type == "pull-request" && isPullRequest) - ); - }); - core.debug(`Config matches on 'issue_type': ${inspect(configMatches)}`); - if (configMatches.length == 0) { - const issueType = isPullRequest ? "pull request" : "issue"; - core.info( - `Command '${commandWords[0]}' is not configured for the issue type '${issueType}'.` - ); - return; - } - - // Filter matching commands by whether or not to allow edits - if (github.context.payload.action == "edited") { - configMatches = configMatches.filter(function(cmd) { - return cmd.allow_edits; - }); - core.debug(`Config matches on 'allow_edits': ${inspect(configMatches)}`); - if (configMatches.length == 0) { - core.info( - `Command '${commandWords[0]}' is not configured to allow edits.` - ); - return; - } - } - - // Set octokit clients - const octokit = new github.GitHub(inputs.token); - const reactionOctokit = new github.GitHub(inputs.reactionToken) - - // At this point we know the command is registered - // Add the "eyes" reaction to the comment - if (inputs.reactions) - await addReaction( - reactionOctokit, - github.context.repo, - commentId, - "eyes" - ); - - // Get the actor permission - const actorPermission = await getActorPermission( - octokit, - github.context.repo, - github.context.actor - ); - core.debug(`Actor permission: ${actorPermission}`); - - // Filter matching commands by the user's permission level - configMatches = configMatches.filter(function(cmd) { - return actorHasPermission(actorPermission, cmd.permission); - }); - core.debug(`Config matches on 'permission': ${inspect(configMatches)}`); - if (configMatches.length == 0) { - core.info( - `Command '${commandWords[0]}' is not configured for the user's permission level '${actorPermission}'.` - ); - return; - } - - // Determined that the command should be dispatched - core.info(`Command '${commandWords[0]}' to be dispatched.`); - - // Define payload - var clientPayload = { - slash_command: {}, - github: github.context - }; - - // Get the pull request context for the dispatch payload - if (isPullRequest) { - const { data: pullRequest } = await octokit.pulls.get({ - ...github.context.repo, - pull_number: github.context.payload.issue.number - }); - clientPayload["pull_request"] = pullRequest; - } - - // Dispatch for each matching configuration - for (const cmd of configMatches) { - // Generate slash command payload - clientPayload.slash_command = getSlashCommandPayload( - commandWords, - cmd.named_args - ); - core.debug( - `Slash command payload: ${inspect(clientPayload.slash_command)}` - ); - // Dispatch the command - const dispatchRepo = cmd.repository.split("/"); - const eventType = cmd.command + cmd.event_type_suffix; - await octokit.repos.createDispatchEvent({ - owner: dispatchRepo[0], - repo: dispatchRepo[1], - event_type: eventType, - client_payload: clientPayload - }); - core.info( - `Command '${cmd.command}' dispatched to '${cmd.repository}' ` + - `with event type '${eventType}'.` - ); - } - - // Add the "rocket" reaction to the comment - if (inputs.reactions) - await addReaction( - reactionOctokit, - github.context.repo, - commentId, - "rocket" - ); - } catch (error) { - core.debug(inspect(error)); - core.setFailed(error.message); - } -} - -run(); - - -/***/ }), - -/***/ 692: -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -/***/ 696: -/***/ (function(module) { - -"use strict"; - - -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -} - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -} - -module.exports = isPlainObject; - - -/***/ }), - -/***/ 697: -/***/ (function(module) { - -"use strict"; - -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); - - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); -}; - - -/***/ }), - -/***/ 742: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var fs = __webpack_require__(747) -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(818) -} else { - core = __webpack_require__(197) -} - -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} - -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} - - -/***/ }), - -/***/ 747: -/***/ (function(module) { - -module.exports = require("fs"); - -/***/ }), - -/***/ 753: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var endpoint = __webpack_require__(385); -var universalUserAgent = __webpack_require__(211); -var isPlainObject = _interopDefault(__webpack_require__(696)); -var nodeFetch = _interopDefault(__webpack_require__(454)); -var requestError = __webpack_require__(463); - -const VERSION = "5.4.2"; - -function getBufferResponse(response) { - return response.arrayBuffer(); -} - -function fetchWrapper(requestOptions) { - if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - - let headers = {}; - let status; - let url; - const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; - return fetch(requestOptions.url, Object.assign({ - method: requestOptions.method, - body: requestOptions.body, - headers: requestOptions.headers, - redirect: requestOptions.redirect - }, requestOptions.request)).then(response => { - url = response.url; - status = response.status; - - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; - } - - if (status === 204 || status === 205) { - return; - } // GitHub API returns 200 for HEAD requests - - - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - - throw new requestError.RequestError(response.statusText, status, { - headers, - request: requestOptions - }); - } - - if (status === 304) { - throw new requestError.RequestError("Not modified", status, { - headers, - request: requestOptions - }); - } - - if (status >= 400) { - return response.text().then(message => { - const error = new requestError.RequestError(message, status, { - headers, - request: requestOptions - }); - - try { - let responseBody = JSON.parse(error.message); - Object.assign(error, responseBody); - let errors = responseBody.errors; // Assumption `errors` would always be in Array format - - error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); - } catch (e) {// ignore, see octokit/rest.js#684 - } - - throw error; - }); - } - - const contentType = response.headers.get("content-type"); - - if (/application\/json/.test(contentType)) { - return response.json(); - } - - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - - return getBufferResponse(response); - }).then(data => { - return { - status, - url, - headers, - data - }; - }).catch(error => { - if (error instanceof requestError.RequestError) { - throw error; - } - - throw new requestError.RequestError(error.message, 500, { - headers, - request: requestOptions - }); - }); -} - -function withDefaults(oldEndpoint, newDefaults) { - const endpoint = oldEndpoint.defaults(newDefaults); - - const newApi = function (route, parameters) { - const endpointOptions = endpoint.merge(route, parameters); - - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint.parse(endpointOptions)); - } - - const request = (route, parameters) => { - return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); - }; - - Object.assign(request, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); - return endpointOptions.request.hook(request, endpointOptions); - }; - - return Object.assign(newApi, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); -} - -const request = withDefaults(endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` - } -}); - -exports.request = request; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 761: -/***/ (function(module) { - -module.exports = require("zlib"); - -/***/ }), - -/***/ 763: -/***/ (function(module) { - -module.exports = removeHook - -function removeHook (state, name, method) { - if (!state.registry[name]) { - return - } - - var index = state.registry[name] - .map(function (registered) { return registered.orig }) - .indexOf(method) - - if (index === -1) { - return - } - - state.registry[name].splice(index, 1) -} - - -/***/ }), - -/***/ 768: -/***/ (function(module) { - -"use strict"; - -module.exports = function (x) { - var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); - var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); - - if (x[x.length - 1] === lf) { - x = x.slice(0, x.length - 1); - } - - if (x[x.length - 1] === cr) { - x = x.slice(0, x.length - 1); - } - - return x; -}; - - -/***/ }), - -/***/ 777: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = getFirstPage - -const getPage = __webpack_require__(265) - -function getFirstPage (octokit, link, headers) { - return getPage(octokit, link, 'first', headers) -} - - -/***/ }), - -/***/ 796: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var osName = _interopDefault(__webpack_require__(2)); - -function getUserAgent() { - try { - return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`; - } catch (error) { - if (/wmic os get Caption/.test(error.message)) { - return "Windows "; - } - - throw error; - } -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 813: -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -async function auth(token) { - const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; - return { - type: "token", - token: token, - tokenType - }; -} - -/** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token - */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - - return `token ${token}`; -} - -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); -} - -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); - } - - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; - -exports.createTokenAuth = createTokenAuth; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 814: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = which -which.sync = whichSync - -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' - -var path = __webpack_require__(622) -var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(742) - -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' - - return er -} - -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - pathEnv = pathEnv.split(colon) - - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) - - - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] - - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } -} - -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } - - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) -} - -function whichSync (cmd, opt) { - opt = opt || {} - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } - - if (opt.all && found.length) - return found - - if (opt.nothrow) - return null - - throw getNotFoundError(cmd) -} - - -/***/ }), - -/***/ 816: -/***/ (function(module) { - -"use strict"; - -module.exports = /^#!.*/; - - -/***/ }), - -/***/ 818: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(747) - -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT - - if (!pathext) { - return true - } - - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} - -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} - - -/***/ }), - -/***/ 835: -/***/ (function(module) { - -module.exports = require("url"); - -/***/ }), - -/***/ 842: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -var deprecation = __webpack_require__(692); - -var endpointsByScope = { - actions: { - cancelWorkflowRun: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/cancel" - }, - createOrUpdateSecretForRepo: { - method: "PUT", - params: { - encrypted_value: { - type: "string" - }, - key_id: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/:name" - }, - createRegistrationToken: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/runners/registration-token" - }, - createRemoveToken: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/runners/remove-token" - }, - deleteArtifact: { - method: "DELETE", - params: { - artifact_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id" - }, - deleteSecretFromRepo: { - method: "DELETE", - params: { - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/:name" - }, - downloadArtifact: { - method: "GET", - params: { - archive_format: { - required: true, - type: "string" - }, - artifact_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format" - }, - getArtifact: { - method: "GET", - params: { - artifact_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id" - }, - getPublicKey: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/public-key" - }, - getSecret: { - method: "GET", - params: { - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/:name" - }, - getSelfHostedRunner: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - runner_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runners/:runner_id" - }, - getWorkflow: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - workflow_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/workflows/:workflow_id" - }, - getWorkflowJob: { - method: "GET", - params: { - job_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/jobs/:job_id" - }, - getWorkflowRun: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id" - }, - listDownloadsForSelfHostedRunnerApplication: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/runners/downloads" - }, - listJobsForWorkflowRun: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/jobs" - }, - listRepoWorkflowRuns: { - method: "GET", - params: { - actor: { - type: "string" - }, - branch: { - type: "string" - }, - event: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - status: { - enum: ["completed", "status", "conclusion"], - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/runs" - }, - listRepoWorkflows: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/workflows" - }, - listSecretsForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets" - }, - listSelfHostedRunnersForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/runners" - }, - listWorkflowJobLogs: { - method: "GET", - params: { - job_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/jobs/:job_id/logs" - }, - listWorkflowRunArtifacts: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts" - }, - listWorkflowRunLogs: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/logs" - }, - listWorkflowRuns: { - method: "GET", - params: { - actor: { - type: "string" - }, - branch: { - type: "string" - }, - event: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - status: { - enum: ["completed", "status", "conclusion"], - type: "string" - }, - workflow_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs" - }, - reRunWorkflow: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - run_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/rerun" - }, - removeSelfHostedRunner: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - runner_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runners/:runner_id" - } - }, - activity: { - checkStarringRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/user/starred/:owner/:repo" - }, - deleteRepoSubscription: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/subscription" - }, - deleteThreadSubscription: { - method: "DELETE", - params: { - thread_id: { - required: true, - type: "integer" - } - }, - url: "/notifications/threads/:thread_id/subscription" - }, - getRepoSubscription: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/subscription" - }, - getThread: { - method: "GET", - params: { - thread_id: { - required: true, - type: "integer" - } - }, - url: "/notifications/threads/:thread_id" - }, - getThreadSubscription: { - method: "GET", - params: { - thread_id: { - required: true, - type: "integer" - } - }, - url: "/notifications/threads/:thread_id/subscription" - }, - listEventsForOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/events/orgs/:org" - }, - listEventsForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/events" - }, - listFeeds: { - method: "GET", - params: {}, - url: "/feeds" - }, - listNotifications: { - method: "GET", - params: { - all: { - type: "boolean" - }, - before: { - type: "string" - }, - page: { - type: "integer" - }, - participating: { - type: "boolean" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - } - }, - url: "/notifications" - }, - listNotificationsForRepo: { - method: "GET", - params: { - all: { - type: "boolean" - }, - before: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - participating: { - type: "boolean" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - } - }, - url: "/repos/:owner/:repo/notifications" - }, - listPublicEvents: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/events" - }, - listPublicEventsForOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/events" - }, - listPublicEventsForRepoNetwork: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/networks/:owner/:repo/events" - }, - listPublicEventsForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/events/public" - }, - listReceivedEventsForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/received_events" - }, - listReceivedPublicEventsForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/received_events/public" - }, - listRepoEvents: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/events" - }, - listReposStarredByAuthenticatedUser: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/user/starred" - }, - listReposStarredByUser: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/starred" - }, - listReposWatchedByUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/subscriptions" - }, - listStargazersForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stargazers" - }, - listWatchedReposForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/subscriptions" - }, - listWatchersForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/subscribers" - }, - markAsRead: { - method: "PUT", - params: { - last_read_at: { - type: "string" - } - }, - url: "/notifications" - }, - markNotificationsAsReadForRepo: { - method: "PUT", - params: { - last_read_at: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/notifications" - }, - markThreadAsRead: { - method: "PATCH", - params: { - thread_id: { - required: true, - type: "integer" - } - }, - url: "/notifications/threads/:thread_id" - }, - setRepoSubscription: { - method: "PUT", - params: { - ignored: { - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - subscribed: { - type: "boolean" - } - }, - url: "/repos/:owner/:repo/subscription" - }, - setThreadSubscription: { - method: "PUT", - params: { - ignored: { - type: "boolean" - }, - thread_id: { - required: true, - type: "integer" - } - }, - url: "/notifications/threads/:thread_id/subscription" - }, - starRepo: { - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/user/starred/:owner/:repo" - }, - unstarRepo: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/user/starred/:owner/:repo" - } - }, - apps: { - addRepoToInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "PUT", - params: { - installation_id: { - required: true, - type: "integer" - }, - repository_id: { - required: true, - type: "integer" - } - }, - url: "/user/installations/:installation_id/repositories/:repository_id" - }, - checkAccountIsAssociatedWithAny: { - method: "GET", - params: { - account_id: { - required: true, - type: "integer" - } - }, - url: "/marketplace_listing/accounts/:account_id" - }, - checkAccountIsAssociatedWithAnyStubbed: { - method: "GET", - params: { - account_id: { - required: true, - type: "integer" - } - }, - url: "/marketplace_listing/stubbed/accounts/:account_id" - }, - checkAuthorization: { - deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization", - method: "GET", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - checkToken: { - headers: { - accept: "application/vnd.github.doctor-strange-preview+json" - }, - method: "POST", - params: { - access_token: { - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/token" - }, - createContentAttachment: { - headers: { - accept: "application/vnd.github.corsair-preview+json" - }, - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - content_reference_id: { - required: true, - type: "integer" - }, - title: { - required: true, - type: "string" - } - }, - url: "/content_references/:content_reference_id/attachments" - }, - createFromManifest: { - headers: { - accept: "application/vnd.github.fury-preview+json" - }, - method: "POST", - params: { - code: { - required: true, - type: "string" - } - }, - url: "/app-manifests/:code/conversions" - }, - createInstallationToken: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "POST", - params: { - installation_id: { - required: true, - type: "integer" - }, - permissions: { - type: "object" - }, - repository_ids: { - type: "integer[]" - } - }, - url: "/app/installations/:installation_id/access_tokens" - }, - deleteAuthorization: { - headers: { - accept: "application/vnd.github.doctor-strange-preview+json" - }, - method: "DELETE", - params: { - access_token: { - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/grant" - }, - deleteInstallation: { - headers: { - accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json" - }, - method: "DELETE", - params: { - installation_id: { - required: true, - type: "integer" - } - }, - url: "/app/installations/:installation_id" - }, - deleteToken: { - headers: { - accept: "application/vnd.github.doctor-strange-preview+json" - }, - method: "DELETE", - params: { - access_token: { - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/token" - }, - findOrgInstallation: { - deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)", - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/installation" - }, - findRepoInstallation: { - deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)", - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/installation" - }, - findUserInstallation: { - deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)", - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/installation" - }, - getAuthenticated: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: {}, - url: "/app" - }, - getBySlug: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - app_slug: { - required: true, - type: "string" - } - }, - url: "/apps/:app_slug" - }, - getInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - installation_id: { - required: true, - type: "integer" - } - }, - url: "/app/installations/:installation_id" - }, - getOrgInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/installation" - }, - getRepoInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/installation" - }, - getUserInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/installation" - }, - listAccountsUserOrOrgOnPlan: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - plan_id: { - required: true, - type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/marketplace_listing/plans/:plan_id/accounts" - }, - listAccountsUserOrOrgOnPlanStubbed: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - plan_id: { - required: true, - type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/marketplace_listing/stubbed/plans/:plan_id/accounts" - }, - listInstallationReposForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - installation_id: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/installations/:installation_id/repositories" - }, - listInstallations: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/app/installations" - }, - listInstallationsForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/installations" - }, - listMarketplacePurchasesForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/marketplace_purchases" - }, - listMarketplacePurchasesForAuthenticatedUserStubbed: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/marketplace_purchases/stubbed" - }, - listPlans: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/marketplace_listing/plans" - }, - listPlansStubbed: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/marketplace_listing/stubbed/plans" - }, - listRepos: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/installation/repositories" - }, - removeRepoFromInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "DELETE", - params: { - installation_id: { - required: true, - type: "integer" - }, - repository_id: { - required: true, - type: "integer" - } - }, - url: "/user/installations/:installation_id/repositories/:repository_id" - }, - resetAuthorization: { - deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization", - method: "POST", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - resetToken: { - headers: { - accept: "application/vnd.github.doctor-strange-preview+json" - }, - method: "PATCH", - params: { - access_token: { - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/token" - }, - revokeAuthorizationForApplication: { - deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application", - method: "DELETE", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - revokeGrantForApplication: { - deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application", - method: "DELETE", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/grants/:access_token" - }, - revokeInstallationToken: { - headers: { - accept: "application/vnd.github.gambit-preview+json" - }, - method: "DELETE", - params: {}, - url: "/installation/token" - } - }, - checks: { - create: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "POST", - params: { - actions: { - type: "object[]" - }, - "actions[].description": { - required: true, - type: "string" - }, - "actions[].identifier": { - required: true, - type: "string" - }, - "actions[].label": { - required: true, - type: "string" - }, - completed_at: { - type: "string" - }, - conclusion: { - enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"], - type: "string" - }, - details_url: { - type: "string" - }, - external_id: { - type: "string" - }, - head_sha: { - required: true, - type: "string" - }, - name: { - required: true, - type: "string" - }, - output: { - type: "object" - }, - "output.annotations": { - type: "object[]" - }, - "output.annotations[].annotation_level": { - enum: ["notice", "warning", "failure"], - required: true, - type: "string" - }, - "output.annotations[].end_column": { - type: "integer" - }, - "output.annotations[].end_line": { - required: true, - type: "integer" - }, - "output.annotations[].message": { - required: true, - type: "string" - }, - "output.annotations[].path": { - required: true, - type: "string" - }, - "output.annotations[].raw_details": { - type: "string" - }, - "output.annotations[].start_column": { - type: "integer" - }, - "output.annotations[].start_line": { - required: true, - type: "integer" - }, - "output.annotations[].title": { - type: "string" - }, - "output.images": { - type: "object[]" - }, - "output.images[].alt": { - required: true, - type: "string" - }, - "output.images[].caption": { - type: "string" - }, - "output.images[].image_url": { - required: true, - type: "string" - }, - "output.summary": { - required: true, - type: "string" - }, - "output.text": { - type: "string" - }, - "output.title": { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - started_at: { - type: "string" - }, - status: { - enum: ["queued", "in_progress", "completed"], - type: "string" - } - }, - url: "/repos/:owner/:repo/check-runs" - }, - createSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "POST", - params: { - head_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-suites" - }, - get: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - check_run_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-runs/:check_run_id" - }, - getSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - check_suite_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-suites/:check_suite_id" - }, - listAnnotations: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - check_run_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations" - }, - listForRef: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - check_name: { - type: "string" - }, - filter: { - enum: ["latest", "all"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - status: { - enum: ["queued", "in_progress", "completed"], - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref/check-runs" - }, - listForSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - check_name: { - type: "string" - }, - check_suite_id: { - required: true, - type: "integer" - }, - filter: { - enum: ["latest", "all"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - status: { - enum: ["queued", "in_progress", "completed"], - type: "string" - } - }, - url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs" - }, - listSuitesForRef: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", - params: { - app_id: { - type: "integer" - }, - check_name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref/check-suites" - }, - rerequestSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "POST", - params: { - check_suite_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest" - }, - setSuitesPreferences: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "PATCH", - params: { - auto_trigger_checks: { - type: "object[]" - }, - "auto_trigger_checks[].app_id": { - required: true, - type: "integer" - }, - "auto_trigger_checks[].setting": { - required: true, - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/check-suites/preferences" - }, - update: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "PATCH", - params: { - actions: { - type: "object[]" - }, - "actions[].description": { - required: true, - type: "string" - }, - "actions[].identifier": { - required: true, - type: "string" - }, - "actions[].label": { - required: true, - type: "string" - }, - check_run_id: { - required: true, - type: "integer" - }, - completed_at: { - type: "string" - }, - conclusion: { - enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"], - type: "string" - }, - details_url: { - type: "string" - }, - external_id: { - type: "string" - }, - name: { - type: "string" - }, - output: { - type: "object" - }, - "output.annotations": { - type: "object[]" - }, - "output.annotations[].annotation_level": { - enum: ["notice", "warning", "failure"], - required: true, - type: "string" - }, - "output.annotations[].end_column": { - type: "integer" - }, - "output.annotations[].end_line": { - required: true, - type: "integer" - }, - "output.annotations[].message": { - required: true, - type: "string" - }, - "output.annotations[].path": { - required: true, - type: "string" - }, - "output.annotations[].raw_details": { - type: "string" - }, - "output.annotations[].start_column": { - type: "integer" - }, - "output.annotations[].start_line": { - required: true, - type: "integer" - }, - "output.annotations[].title": { - type: "string" - }, - "output.images": { - type: "object[]" - }, - "output.images[].alt": { - required: true, - type: "string" - }, - "output.images[].caption": { - type: "string" - }, - "output.images[].image_url": { - required: true, - type: "string" - }, - "output.summary": { - required: true, - type: "string" - }, - "output.text": { - type: "string" - }, - "output.title": { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - started_at: { - type: "string" - }, - status: { - enum: ["queued", "in_progress", "completed"], - type: "string" - } - }, - url: "/repos/:owner/:repo/check-runs/:check_run_id" - } - }, - codesOfConduct: { - getConductCode: { - headers: { - accept: "application/vnd.github.scarlet-witch-preview+json" - }, - method: "GET", - params: { - key: { - required: true, - type: "string" - } - }, - url: "/codes_of_conduct/:key" - }, - getForRepo: { - headers: { - accept: "application/vnd.github.scarlet-witch-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/community/code_of_conduct" - }, - listConductCodes: { - headers: { - accept: "application/vnd.github.scarlet-witch-preview+json" - }, - method: "GET", - params: {}, - url: "/codes_of_conduct" - } - }, - emojis: { - get: { - method: "GET", - params: {}, - url: "/emojis" - } - }, - gists: { - checkIsStarred: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/star" - }, - create: { - method: "POST", - params: { - description: { - type: "string" - }, - files: { - required: true, - type: "object" - }, - "files.content": { - type: "string" - }, - public: { - type: "boolean" - } - }, - url: "/gists" - }, - createComment: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/comments" - }, - delete: { - method: "DELETE", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id" - }, - deleteComment: { - method: "DELETE", - params: { - comment_id: { - required: true, - type: "integer" - }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/comments/:comment_id" - }, - fork: { - method: "POST", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/forks" - }, - get: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id" - }, - getComment: { - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/comments/:comment_id" - }, - getRevision: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - }, - sha: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/:sha" - }, - list: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - } - }, - url: "/gists" - }, - listComments: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/gists/:gist_id/comments" - }, - listCommits: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/gists/:gist_id/commits" - }, - listForks: { - method: "GET", - params: { - gist_id: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/gists/:gist_id/forks" - }, - listPublic: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - } - }, - url: "/gists/public" - }, - listPublicForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/gists" - }, - listStarred: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - } - }, - url: "/gists/starred" - }, - star: { - method: "PUT", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/star" - }, - unstar: { - method: "DELETE", - params: { - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/star" - }, - update: { - method: "PATCH", - params: { - description: { - type: "string" - }, - files: { - type: "object" - }, - "files.content": { - type: "string" - }, - "files.filename": { - type: "string" - }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id" - }, - updateComment: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_id: { - required: true, - type: "integer" - }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/comments/:comment_id" - } - }, - git: { - createBlob: { - method: "POST", - params: { - content: { - required: true, - type: "string" - }, - encoding: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/blobs" - }, - createCommit: { - method: "POST", - params: { - author: { - type: "object" - }, - "author.date": { - type: "string" - }, - "author.email": { - type: "string" - }, - "author.name": { - type: "string" - }, - committer: { - type: "object" - }, - "committer.date": { - type: "string" - }, - "committer.email": { - type: "string" - }, - "committer.name": { - type: "string" - }, - message: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - parents: { - required: true, - type: "string[]" - }, - repo: { - required: true, - type: "string" - }, - signature: { - type: "string" - }, - tree: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/commits" - }, - createRef: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/refs" - }, - createTag: { - method: "POST", - params: { - message: { - required: true, - type: "string" - }, - object: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - tag: { - required: true, - type: "string" - }, - tagger: { - type: "object" - }, - "tagger.date": { - type: "string" - }, - "tagger.email": { - type: "string" - }, - "tagger.name": { - type: "string" - }, - type: { - enum: ["commit", "tree", "blob"], - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/tags" - }, - createTree: { - method: "POST", - params: { - base_tree: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - tree: { - required: true, - type: "object[]" - }, - "tree[].content": { - type: "string" - }, - "tree[].mode": { - enum: ["100644", "100755", "040000", "160000", "120000"], - type: "string" - }, - "tree[].path": { - type: "string" - }, - "tree[].sha": { - allowNull: true, - type: "string" - }, - "tree[].type": { - enum: ["blob", "tree", "commit"], - type: "string" - } - }, - url: "/repos/:owner/:repo/git/trees" - }, - deleteRef: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/refs/:ref" - }, - getBlob: { - method: "GET", - params: { - file_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/blobs/:file_sha" - }, - getCommit: { - method: "GET", - params: { - commit_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/commits/:commit_sha" - }, - getRef: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/ref/:ref" - }, - getTag: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - tag_sha: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/tags/:tag_sha" - }, - getTree: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - recursive: { - enum: ["1"], - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - tree_sha: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/trees/:tree_sha" - }, - listMatchingRefs: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/matching-refs/:ref" - }, - listRefs: { - method: "GET", - params: { - namespace: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/refs/:namespace" - }, - updateRef: { - method: "PATCH", - params: { - force: { - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/git/refs/:ref" - } - }, - gitignore: { - getTemplate: { - method: "GET", - params: { - name: { - required: true, - type: "string" - } - }, - url: "/gitignore/templates/:name" - }, - listTemplates: { - method: "GET", - params: {}, - url: "/gitignore/templates" - } - }, - interactions: { - addOrUpdateRestrictionsForOrg: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "PUT", - params: { - limit: { - enum: ["existing_users", "contributors_only", "collaborators_only"], - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/interaction-limits" - }, - addOrUpdateRestrictionsForRepo: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "PUT", - params: { - limit: { - enum: ["existing_users", "contributors_only", "collaborators_only"], - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/interaction-limits" - }, - getRestrictionsForOrg: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/interaction-limits" - }, - getRestrictionsForRepo: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/interaction-limits" - }, - removeRestrictionsForOrg: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "DELETE", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/interaction-limits" - }, - removeRestrictionsForRepo: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/interaction-limits" - } - }, - issues: { - addAssignees: { - method: "POST", - params: { - assignees: { - type: "string[]" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/assignees" - }, - addLabels: { - method: "POST", - params: { - issue_number: { - required: true, - type: "integer" - }, - labels: { - required: true, - type: "string[]" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" - }, - checkAssignee: { - method: "GET", - params: { - assignee: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/assignees/:assignee" - }, - create: { - method: "POST", - params: { - assignee: { - type: "string" - }, - assignees: { - type: "string[]" - }, - body: { - type: "string" - }, - labels: { - type: "string[]" - }, - milestone: { - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - title: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues" - }, - createComment: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/comments" - }, - createLabel: { - method: "POST", - params: { - color: { - required: true, - type: "string" - }, - description: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/labels" - }, - createMilestone: { - method: "POST", - params: { - description: { - type: "string" - }, - due_on: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["open", "closed"], - type: "string" - }, - title: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones" - }, - deleteComment: { - method: "DELETE", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" - }, - deleteLabel: { - method: "DELETE", - params: { - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/labels/:name" - }, - deleteMilestone: { - method: "DELETE", - params: { - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones/:milestone_number" - }, - get: { - method: "GET", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number" - }, - getComment: { - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" - }, - getEvent: { - method: "GET", - params: { - event_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/events/:event_id" - }, - getLabel: { - method: "GET", - params: { - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/labels/:name" - }, - getMilestone: { - method: "GET", - params: { - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones/:milestone_number" - }, - list: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - filter: { - enum: ["assigned", "created", "mentioned", "subscribed", "all"], - type: "string" - }, - labels: { - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated", "comments"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/issues" - }, - listAssignees: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/assignees" - }, - listComments: { - method: "GET", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/comments" - }, - listCommentsForRepo: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments" - }, - listEvents: { - method: "GET", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/events" - }, - listEventsForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/events" - }, - listEventsForTimeline: { - headers: { - accept: "application/vnd.github.mockingbird-preview+json" - }, - method: "GET", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/timeline" - }, - listForAuthenticatedUser: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - filter: { - enum: ["assigned", "created", "mentioned", "subscribed", "all"], - type: "string" - }, - labels: { - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated", "comments"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/user/issues" - }, - listForOrg: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - filter: { - enum: ["assigned", "created", "mentioned", "subscribed", "all"], - type: "string" - }, - labels: { - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated", "comments"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/orgs/:org/issues" - }, - listForRepo: { - method: "GET", - params: { - assignee: { - type: "string" - }, - creator: { - type: "string" - }, - direction: { - enum: ["asc", "desc"], - type: "string" - }, - labels: { - type: "string" - }, - mentioned: { - type: "string" - }, - milestone: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated", "comments"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/repos/:owner/:repo/issues" - }, - listLabelsForMilestone: { - method: "GET", - params: { - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones/:milestone_number/labels" - }, - listLabelsForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/labels" - }, - listLabelsOnIssue: { - method: "GET", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" - }, - listMilestonesForRepo: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sort: { - enum: ["due_on", "completeness"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones" - }, - lock: { - method: "PUT", - params: { - issue_number: { - required: true, - type: "integer" - }, - lock_reason: { - enum: ["off-topic", "too heated", "resolved", "spam"], - type: "string" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/lock" - }, - removeAssignees: { - method: "DELETE", - params: { - assignees: { - type: "string[]" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/assignees" - }, - removeLabel: { - method: "DELETE", - params: { - issue_number: { - required: true, - type: "integer" - }, - name: { - required: true, - type: "string" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/labels/:name" - }, - removeLabels: { - method: "DELETE", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" - }, - replaceLabels: { - method: "PUT", - params: { - issue_number: { - required: true, - type: "integer" - }, - labels: { - type: "string[]" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" - }, - unlock: { - method: "DELETE", - params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/lock" - }, - update: { - method: "PATCH", - params: { - assignee: { - type: "string" - }, - assignees: { - type: "string[]" - }, - body: { - type: "string" - }, - issue_number: { - required: true, - type: "integer" - }, - labels: { - type: "string[]" - }, - milestone: { - allowNull: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["open", "closed"], - type: "string" - }, - title: { - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number" - }, - updateComment: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" - }, - updateLabel: { - method: "PATCH", - params: { - color: { - type: "string" - }, - current_name: { - required: true, - type: "string" - }, - description: { - type: "string" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/labels/:current_name" - }, - updateMilestone: { - method: "PATCH", - params: { - description: { - type: "string" - }, - due_on: { - type: "string" - }, - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["open", "closed"], - type: "string" - }, - title: { - type: "string" - } - }, - url: "/repos/:owner/:repo/milestones/:milestone_number" - } - }, - licenses: { - get: { - method: "GET", - params: { - license: { - required: true, - type: "string" - } - }, - url: "/licenses/:license" - }, - getForRepo: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/license" - }, - list: { - deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)", - method: "GET", - params: {}, - url: "/licenses" - }, - listCommonlyUsed: { - method: "GET", - params: {}, - url: "/licenses" - } - }, - markdown: { - render: { - method: "POST", - params: { - context: { - type: "string" - }, - mode: { - enum: ["markdown", "gfm"], - type: "string" - }, - text: { - required: true, - type: "string" - } - }, - url: "/markdown" - }, - renderRaw: { - headers: { - "content-type": "text/plain; charset=utf-8" - }, - method: "POST", - params: { - data: { - mapTo: "data", - required: true, - type: "string" - } - }, - url: "/markdown/raw" - } - }, - meta: { - get: { - method: "GET", - params: {}, - url: "/meta" - } - }, - migrations: { - cancelImport: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/import" - }, - deleteArchiveForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "DELETE", - params: { - migration_id: { - required: true, - type: "integer" - } - }, - url: "/user/migrations/:migration_id/archive" - }, - deleteArchiveForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "DELETE", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/migrations/:migration_id/archive" - }, - downloadArchiveForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/migrations/:migration_id/archive" - }, - getArchiveForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - } - }, - url: "/user/migrations/:migration_id/archive" - }, - getArchiveForOrg: { - deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)", - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/migrations/:migration_id/archive" - }, - getCommitAuthors: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - } - }, - url: "/repos/:owner/:repo/import/authors" - }, - getImportProgress: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/import" - }, - getLargeFiles: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/import/large_files" - }, - getStatusForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - } - }, - url: "/user/migrations/:migration_id" - }, - getStatusForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/migrations/:migration_id" - }, - listForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/migrations" - }, - listForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/migrations" - }, - listReposForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/migrations/:migration_id/repositories" - }, - listReposForUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "GET", - params: { - migration_id: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/:migration_id/repositories" - }, - mapCommitAuthor: { - method: "PATCH", - params: { - author_id: { - required: true, - type: "integer" - }, - email: { - type: "string" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/import/authors/:author_id" - }, - setLfsPreference: { - method: "PATCH", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - use_lfs: { - enum: ["opt_in", "opt_out"], - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/import/lfs" - }, - startForAuthenticatedUser: { - method: "POST", - params: { - exclude_attachments: { - type: "boolean" - }, - lock_repositories: { - type: "boolean" - }, - repositories: { - required: true, - type: "string[]" - } - }, - url: "/user/migrations" - }, - startForOrg: { - method: "POST", - params: { - exclude_attachments: { - type: "boolean" - }, - lock_repositories: { - type: "boolean" - }, - org: { - required: true, - type: "string" - }, - repositories: { - required: true, - type: "string[]" - } - }, - url: "/orgs/:org/migrations" - }, - startImport: { - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - tfvc_project: { - type: "string" - }, - vcs: { - enum: ["subversion", "git", "mercurial", "tfvc"], - type: "string" - }, - vcs_password: { - type: "string" - }, - vcs_url: { - required: true, - type: "string" - }, - vcs_username: { - type: "string" - } - }, - url: "/repos/:owner/:repo/import" - }, - unlockRepoForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "DELETE", - params: { - migration_id: { - required: true, - type: "integer" - }, - repo_name: { - required: true, - type: "string" - } - }, - url: "/user/migrations/:migration_id/repos/:repo_name/lock" - }, - unlockRepoForOrg: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "DELETE", - params: { - migration_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - repo_name: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock" - }, - updateImport: { - method: "PATCH", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - vcs_password: { - type: "string" - }, - vcs_username: { - type: "string" - } - }, - url: "/repos/:owner/:repo/import" - } - }, - oauthAuthorizations: { - checkAuthorization: { - deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)", - method: "GET", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - createAuthorization: { - deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization", - method: "POST", - params: { - client_id: { - type: "string" - }, - client_secret: { - type: "string" - }, - fingerprint: { - type: "string" - }, - note: { - required: true, - type: "string" - }, - note_url: { - type: "string" - }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations" - }, - deleteAuthorization: { - deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization", - method: "DELETE", - params: { - authorization_id: { - required: true, - type: "integer" - } - }, - url: "/authorizations/:authorization_id" - }, - deleteGrant: { - deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant", - method: "DELETE", - params: { - grant_id: { - required: true, - type: "integer" - } - }, - url: "/applications/grants/:grant_id" - }, - getAuthorization: { - deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization", - method: "GET", - params: { - authorization_id: { - required: true, - type: "integer" - } - }, - url: "/authorizations/:authorization_id" - }, - getGrant: { - deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant", - method: "GET", - params: { - grant_id: { - required: true, - type: "integer" - } - }, - url: "/applications/grants/:grant_id" - }, - getOrCreateAuthorizationForApp: { - deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app", - method: "PUT", - params: { - client_id: { - required: true, - type: "string" - }, - client_secret: { - required: true, - type: "string" - }, - fingerprint: { - type: "string" - }, - note: { - type: "string" - }, - note_url: { - type: "string" - }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations/clients/:client_id" - }, - getOrCreateAuthorizationForAppAndFingerprint: { - deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint", - method: "PUT", - params: { - client_id: { - required: true, - type: "string" - }, - client_secret: { - required: true, - type: "string" - }, - fingerprint: { - required: true, - type: "string" - }, - note: { - type: "string" - }, - note_url: { - type: "string" - }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations/clients/:client_id/:fingerprint" - }, - getOrCreateAuthorizationForAppFingerprint: { - deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)", - method: "PUT", - params: { - client_id: { - required: true, - type: "string" - }, - client_secret: { - required: true, - type: "string" - }, - fingerprint: { - required: true, - type: "string" - }, - note: { - type: "string" - }, - note_url: { - type: "string" - }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations/clients/:client_id/:fingerprint" - }, - listAuthorizations: { - deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/authorizations" - }, - listGrants: { - deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/applications/grants" - }, - resetAuthorization: { - deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)", - method: "POST", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - revokeAuthorizationForApplication: { - deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)", - method: "DELETE", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/tokens/:access_token" - }, - revokeGrantForApplication: { - deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)", - method: "DELETE", - params: { - access_token: { - required: true, - type: "string" - }, - client_id: { - required: true, - type: "string" - } - }, - url: "/applications/:client_id/grants/:access_token" - }, - updateAuthorization: { - deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization", - method: "PATCH", - params: { - add_scopes: { - type: "string[]" - }, - authorization_id: { - required: true, - type: "integer" - }, - fingerprint: { - type: "string" - }, - note: { - type: "string" - }, - note_url: { - type: "string" - }, - remove_scopes: { - type: "string[]" - }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations/:authorization_id" - } - }, - orgs: { - addOrUpdateMembership: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - role: { - enum: ["admin", "member"], - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/memberships/:username" - }, - blockUser: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/blocks/:username" - }, - checkBlockedUser: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/blocks/:username" - }, - checkMembership: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/members/:username" - }, - checkPublicMembership: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/public_members/:username" - }, - concealMembership: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/public_members/:username" - }, - convertMemberToOutsideCollaborator: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/outside_collaborators/:username" - }, - createHook: { - method: "POST", - params: { - active: { - type: "boolean" - }, - config: { - required: true, - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { - type: "string" - }, - "config.secret": { - type: "string" - }, - "config.url": { - required: true, - type: "string" - }, - events: { - type: "string[]" - }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/hooks" - }, - createInvitation: { - method: "POST", - params: { - email: { - type: "string" - }, - invitee_id: { - type: "integer" - }, - org: { - required: true, - type: "string" - }, - role: { - enum: ["admin", "direct_member", "billing_manager"], - type: "string" - }, - team_ids: { - type: "integer[]" - } - }, - url: "/orgs/:org/invitations" - }, - deleteHook: { - method: "DELETE", - params: { - hook_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/hooks/:hook_id" - }, - get: { - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org" - }, - getHook: { - method: "GET", - params: { - hook_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/hooks/:hook_id" - }, - getMembership: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/memberships/:username" - }, - getMembershipForAuthenticatedUser: { - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/user/memberships/orgs/:org" - }, - list: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "integer" - } - }, - url: "/organizations" - }, - listBlockedUsers: { - method: "GET", - params: { - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/blocks" - }, - listForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/orgs" - }, - listForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/orgs" - }, - listHooks: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/hooks" - }, - listInstallations: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/installations" - }, - listInvitationTeams: { - method: "GET", - params: { - invitation_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/invitations/:invitation_id/teams" - }, - listMembers: { - method: "GET", - params: { - filter: { - enum: ["2fa_disabled", "all"], - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - role: { - enum: ["all", "admin", "member"], - type: "string" - } - }, - url: "/orgs/:org/members" - }, - listMemberships: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - state: { - enum: ["active", "pending"], - type: "string" - } - }, - url: "/user/memberships/orgs" - }, - listOutsideCollaborators: { - method: "GET", - params: { - filter: { - enum: ["2fa_disabled", "all"], - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/outside_collaborators" - }, - listPendingInvitations: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/invitations" - }, - listPublicMembers: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/public_members" - }, - pingHook: { - method: "POST", - params: { - hook_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/hooks/:hook_id/pings" - }, - publicizeMembership: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/public_members/:username" - }, - removeMember: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/members/:username" - }, - removeMembership: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/memberships/:username" - }, - removeOutsideCollaborator: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/outside_collaborators/:username" - }, - unblockUser: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/blocks/:username" - }, - update: { - method: "PATCH", - params: { - billing_email: { - type: "string" - }, - company: { - type: "string" - }, - default_repository_permission: { - enum: ["read", "write", "admin", "none"], - type: "string" - }, - description: { - type: "string" - }, - email: { - type: "string" - }, - has_organization_projects: { - type: "boolean" - }, - has_repository_projects: { - type: "boolean" - }, - location: { - type: "string" - }, - members_allowed_repository_creation_type: { - enum: ["all", "private", "none"], - type: "string" - }, - members_can_create_internal_repositories: { - type: "boolean" - }, - members_can_create_private_repositories: { - type: "boolean" - }, - members_can_create_public_repositories: { - type: "boolean" - }, - members_can_create_repositories: { - type: "boolean" - }, - name: { - type: "string" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org" - }, - updateHook: { - method: "PATCH", - params: { - active: { - type: "boolean" - }, - config: { - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { - type: "string" - }, - "config.secret": { - type: "string" - }, - "config.url": { - required: true, - type: "string" - }, - events: { - type: "string[]" - }, - hook_id: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/hooks/:hook_id" - }, - updateMembership: { - method: "PATCH", - params: { - org: { - required: true, - type: "string" - }, - state: { - enum: ["active"], - required: true, - type: "string" - } - }, - url: "/user/memberships/orgs/:org" - } - }, - projects: { - addCollaborator: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PUT", - params: { - permission: { - enum: ["read", "write", "admin"], - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/projects/:project_id/collaborators/:username" - }, - createCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - column_id: { - required: true, - type: "integer" - }, - content_id: { - type: "integer" - }, - content_type: { - type: "string" - }, - note: { - type: "string" - } - }, - url: "/projects/columns/:column_id/cards" - }, - createColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - name: { - required: true, - type: "string" - }, - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id/columns" - }, - createForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - body: { - type: "string" - }, - name: { - required: true, - type: "string" - } - }, - url: "/user/projects" - }, - createForOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - body: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/projects" - }, - createForRepo: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - body: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/projects" - }, - delete: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id" - }, - deleteCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - card_id: { - required: true, - type: "integer" - } - }, - url: "/projects/columns/cards/:card_id" - }, - deleteColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - column_id: { - required: true, - type: "integer" - } - }, - url: "/projects/columns/:column_id" - }, - get: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id" - }, - getCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - card_id: { - required: true, - type: "integer" - } - }, - url: "/projects/columns/cards/:card_id" - }, - getColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - column_id: { - required: true, - type: "integer" - } - }, - url: "/projects/columns/:column_id" - }, - listCards: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - archived_state: { - enum: ["all", "archived", "not_archived"], - type: "string" - }, - column_id: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/projects/columns/:column_id/cards" - }, - listCollaborators: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - affiliation: { - enum: ["outside", "direct", "all"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id/collaborators" - }, - listColumns: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id/columns" - }, - listForOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/orgs/:org/projects" - }, - listForRepo: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/repos/:owner/:repo/projects" - }, - listForUser: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/projects" - }, - moveCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - card_id: { - required: true, - type: "integer" - }, - column_id: { - type: "integer" - }, - position: { - required: true, - type: "string", - validation: "^(top|bottom|after:\\d+)$" - } - }, - url: "/projects/columns/cards/:card_id/moves" - }, - moveColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - column_id: { - required: true, - type: "integer" - }, - position: { - required: true, - type: "string", - validation: "^(first|last|after:\\d+)$" - } - }, - url: "/projects/columns/:column_id/moves" - }, - removeCollaborator: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - project_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/projects/:project_id/collaborators/:username" - }, - reviewUserPermissionLevel: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - project_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/projects/:project_id/collaborators/:username/permission" - }, - update: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PATCH", - params: { - body: { - type: "string" - }, - name: { - type: "string" - }, - organization_permission: { - type: "string" - }, - private: { - type: "boolean" - }, - project_id: { - required: true, - type: "integer" - }, - state: { - enum: ["open", "closed"], - type: "string" - } - }, - url: "/projects/:project_id" - }, - updateCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PATCH", - params: { - archived: { - type: "boolean" - }, - card_id: { - required: true, - type: "integer" - }, - note: { - type: "string" - } - }, - url: "/projects/columns/cards/:card_id" - }, - updateColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PATCH", - params: { - column_id: { - required: true, - type: "integer" - }, - name: { - required: true, - type: "string" - } - }, - url: "/projects/columns/:column_id" - } - }, - pulls: { - checkIfMerged: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/merge" - }, - create: { - method: "POST", - params: { - base: { - required: true, - type: "string" - }, - body: { - type: "string" - }, - draft: { - type: "boolean" - }, - head: { - required: true, - type: "string" - }, - maintainer_can_modify: { - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - title: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls" - }, - createComment: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - commit_id: { - required: true, - type: "string" - }, - in_reply_to: { - deprecated: true, - description: "The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.", - type: "integer" - }, - line: { - type: "integer" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - position: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - side: { - enum: ["LEFT", "RIGHT"], - type: "string" - }, - start_line: { - type: "integer" - }, - start_side: { - enum: ["LEFT", "RIGHT", "side"], - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments" - }, - createCommentReply: { - deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)", - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - commit_id: { - required: true, - type: "string" - }, - in_reply_to: { - deprecated: true, - description: "The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.", - type: "integer" - }, - line: { - type: "integer" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - position: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - side: { - enum: ["LEFT", "RIGHT"], - type: "string" - }, - start_line: { - type: "integer" - }, - start_side: { - enum: ["LEFT", "RIGHT", "side"], - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments" - }, - createFromIssue: { - deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request", - method: "POST", - params: { - base: { - required: true, - type: "string" - }, - draft: { - type: "boolean" - }, - head: { - required: true, - type: "string" - }, - issue: { - required: true, - type: "integer" - }, - maintainer_can_modify: { - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls" - }, - createReview: { - method: "POST", - params: { - body: { - type: "string" - }, - comments: { - type: "object[]" - }, - "comments[].body": { - required: true, - type: "string" - }, - "comments[].path": { - required: true, - type: "string" - }, - "comments[].position": { - required: true, - type: "integer" - }, - commit_id: { - type: "string" - }, - event: { - enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews" - }, - createReviewCommentReply: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies" - }, - createReviewRequest: { - method: "POST", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - reviewers: { - type: "string[]" - }, - team_reviewers: { - type: "string[]" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" - }, - deleteComment: { - method: "DELETE", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" - }, - deletePendingReview: { - method: "DELETE", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" - }, - deleteReviewRequest: { - method: "DELETE", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - reviewers: { - type: "string[]" - }, - team_reviewers: { - type: "string[]" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" - }, - dismissReview: { - method: "PUT", - params: { - message: { - required: true, - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals" - }, - get: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number" - }, - getComment: { - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" - }, - getCommentsForReview: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments" - }, - getReview: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" - }, - list: { - method: "GET", - params: { - base: { - type: "string" - }, - direction: { - enum: ["asc", "desc"], - type: "string" - }, - head: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sort: { - enum: ["created", "updated", "popularity", "long-running"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls" - }, - listComments: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments" - }, - listCommentsForRepo: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments" - }, - listCommits: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/commits" - }, - listFiles: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/files" - }, - listReviewRequests: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" - }, - listReviews: { - method: "GET", - params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews" - }, - merge: { - method: "PUT", - params: { - commit_message: { - type: "string" - }, - commit_title: { - type: "string" - }, - merge_method: { - enum: ["merge", "squash", "rebase"], - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/merge" - }, - submitReview: { - method: "POST", - params: { - body: { - type: "string" - }, - event: { - enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], - required: true, - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events" - }, - update: { - method: "PATCH", - params: { - base: { - type: "string" - }, - body: { - type: "string" - }, - maintainer_can_modify: { - type: "boolean" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["open", "closed"], - type: "string" - }, - title: { - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number" - }, - updateBranch: { - headers: { - accept: "application/vnd.github.lydian-preview+json" - }, - method: "PUT", - params: { - expected_head_sha: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/update-branch" - }, - updateComment: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" - }, - updateReview: { - method: "PUT", - params: { - body: { - required: true, - type: "string" - }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" - } - }, - rateLimit: { - get: { - method: "GET", - params: {}, - url: "/rate_limit" - } - }, - reactions: { - createForCommitComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments/:comment_id/reactions" - }, - createForIssue: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/reactions" - }, - createForIssueComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions" - }, - createForPullRequestReviewComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions" - }, - createForTeamDiscussion: { - deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" - }, - createForTeamDiscussionComment: { - deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" - }, - createForTeamDiscussionCommentInOrg: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions" - }, - createForTeamDiscussionCommentLegacy: { - deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" - }, - createForTeamDiscussionInOrg: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" - }, - createForTeamDiscussionLegacy: { - deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" - }, - delete: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "DELETE", - params: { - reaction_id: { - required: true, - type: "integer" - } - }, - url: "/reactions/:reaction_id" - }, - listForCommitComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments/:comment_id/reactions" - }, - listForIssue: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number/reactions" - }, - listForIssueComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions" - }, - listForPullRequestReviewComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions" - }, - listForTeamDiscussion: { - deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" - }, - listForTeamDiscussionComment: { - deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" - }, - listForTeamDiscussionCommentInOrg: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions" - }, - listForTeamDiscussionCommentLegacy: { - deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" - }, - listForTeamDiscussionInOrg: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" - }, - listForTeamDiscussionLegacy: { - deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy", - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", - params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" - } - }, - repos: { - acceptInvitation: { - method: "PATCH", - params: { - invitation_id: { - required: true, - type: "integer" - } - }, - url: "/user/repository_invitations/:invitation_id" - }, - addCollaborator: { - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - repo: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/collaborators/:username" - }, - addDeployKey: { - method: "POST", - params: { - key: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - read_only: { - type: "boolean" - }, - repo: { - required: true, - type: "string" - }, - title: { - type: "string" - } - }, - url: "/repos/:owner/:repo/keys" - }, - addProtectedBranchAdminEnforcement: { - method: "POST", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" - }, - addProtectedBranchAppRestrictions: { - method: "POST", - params: { - apps: { - mapTo: "data", - required: true, - type: "string[]" - }, - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" - }, - addProtectedBranchRequiredSignatures: { - headers: { - accept: "application/vnd.github.zzzax-preview+json" - }, - method: "POST", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" - }, - addProtectedBranchRequiredStatusChecksContexts: { - method: "POST", - params: { - branch: { - required: true, - type: "string" - }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" - }, - addProtectedBranchTeamRestrictions: { - method: "POST", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - teams: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - addProtectedBranchUserRestrictions: { - method: "POST", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - users: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - checkCollaborator: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/collaborators/:username" - }, - checkVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/vulnerability-alerts" - }, - compareCommits: { - method: "GET", - params: { - base: { - required: true, - type: "string" - }, - head: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/compare/:base...:head" - }, - createCommitComment: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - commit_sha: { - required: true, - type: "string" - }, - line: { - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - path: { - type: "string" - }, - position: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sha: { - alias: "commit_sha", - deprecated: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:commit_sha/comments" - }, - createDeployment: { - method: "POST", - params: { - auto_merge: { - type: "boolean" - }, - description: { - type: "string" - }, - environment: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - payload: { - type: "string" - }, - production_environment: { - type: "boolean" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - required_contexts: { - type: "string[]" - }, - task: { - type: "string" - }, - transient_environment: { - type: "boolean" - } - }, - url: "/repos/:owner/:repo/deployments" - }, - createDeploymentStatus: { - method: "POST", - params: { - auto_inactive: { - type: "boolean" - }, - deployment_id: { - required: true, - type: "integer" - }, - description: { - type: "string" - }, - environment: { - enum: ["production", "staging", "qa"], - type: "string" - }, - environment_url: { - type: "string" - }, - log_url: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - state: { - enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"], - required: true, - type: "string" - }, - target_url: { - type: "string" - } - }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" - }, - createDispatchEvent: { - method: "POST", - params: { - client_payload: { - type: "object" - }, - event_type: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/dispatches" - }, - createFile: { - deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", - method: "PUT", - params: { - author: { - type: "object" - }, - "author.email": { - required: true, - type: "string" - }, - "author.name": { - required: true, - type: "string" - }, - branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { - required: true, - type: "string" - }, - "committer.name": { - required: true, - type: "string" - }, - content: { - required: true, - type: "string" - }, - message: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - } - }, - url: "/repos/:owner/:repo/contents/:path" - }, - createForAuthenticatedUser: { - method: "POST", - params: { - allow_merge_commit: { - type: "boolean" - }, - allow_rebase_merge: { - type: "boolean" - }, - allow_squash_merge: { - type: "boolean" - }, - auto_init: { - type: "boolean" - }, - delete_branch_on_merge: { - type: "boolean" - }, - description: { - type: "string" - }, - gitignore_template: { - type: "string" - }, - has_issues: { - type: "boolean" - }, - has_projects: { - type: "boolean" - }, - has_wiki: { - type: "boolean" - }, - homepage: { - type: "string" - }, - is_template: { - type: "boolean" - }, - license_template: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_id: { - type: "integer" - }, - visibility: { - enum: ["public", "private", "visibility", "internal"], - type: "string" - } - }, - url: "/user/repos" - }, - createFork: { - method: "POST", - params: { - organization: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/forks" - }, - createHook: { - method: "POST", - params: { - active: { - type: "boolean" - }, - config: { - required: true, - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { - type: "string" - }, - "config.secret": { - type: "string" - }, - "config.url": { - required: true, - type: "string" - }, - events: { - type: "string[]" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks" - }, - createInOrg: { - method: "POST", - params: { - allow_merge_commit: { - type: "boolean" - }, - allow_rebase_merge: { - type: "boolean" - }, - allow_squash_merge: { - type: "boolean" - }, - auto_init: { - type: "boolean" - }, - delete_branch_on_merge: { - type: "boolean" - }, - description: { - type: "string" - }, - gitignore_template: { - type: "string" - }, - has_issues: { - type: "boolean" - }, - has_projects: { - type: "boolean" - }, - has_wiki: { - type: "boolean" - }, - homepage: { - type: "string" - }, - is_template: { - type: "boolean" - }, - license_template: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_id: { - type: "integer" - }, - visibility: { - enum: ["public", "private", "visibility", "internal"], - type: "string" - } - }, - url: "/orgs/:org/repos" - }, - createOrUpdateFile: { - method: "PUT", - params: { - author: { - type: "object" - }, - "author.email": { - required: true, - type: "string" - }, - "author.name": { - required: true, - type: "string" - }, - branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { - required: true, - type: "string" - }, - "committer.name": { - required: true, - type: "string" - }, - content: { - required: true, - type: "string" - }, - message: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - } - }, - url: "/repos/:owner/:repo/contents/:path" - }, - createRelease: { - method: "POST", - params: { - body: { - type: "string" - }, - draft: { - type: "boolean" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - prerelease: { - type: "boolean" - }, - repo: { - required: true, - type: "string" - }, - tag_name: { - required: true, - type: "string" - }, - target_commitish: { - type: "string" - } - }, - url: "/repos/:owner/:repo/releases" - }, - createStatus: { - method: "POST", - params: { - context: { - type: "string" - }, - description: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - required: true, - type: "string" - }, - state: { - enum: ["error", "failure", "pending", "success"], - required: true, - type: "string" - }, - target_url: { - type: "string" - } - }, - url: "/repos/:owner/:repo/statuses/:sha" - }, - createUsingTemplate: { - headers: { - accept: "application/vnd.github.baptiste-preview+json" - }, - method: "POST", - params: { - description: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - owner: { - type: "string" - }, - private: { - type: "boolean" - }, - template_owner: { - required: true, - type: "string" - }, - template_repo: { - required: true, - type: "string" - } - }, - url: "/repos/:template_owner/:template_repo/generate" - }, - declineInvitation: { - method: "DELETE", - params: { - invitation_id: { - required: true, - type: "integer" - } - }, - url: "/user/repository_invitations/:invitation_id" - }, - delete: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo" - }, - deleteCommitComment: { - method: "DELETE", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments/:comment_id" - }, - deleteDownload: { - method: "DELETE", - params: { - download_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/downloads/:download_id" - }, - deleteFile: { - method: "DELETE", - params: { - author: { - type: "object" - }, - "author.email": { - type: "string" - }, - "author.name": { - type: "string" - }, - branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { - type: "string" - }, - "committer.name": { - type: "string" - }, - message: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/contents/:path" - }, - deleteHook: { - method: "DELETE", - params: { - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks/:hook_id" - }, - deleteInvitation: { - method: "DELETE", - params: { - invitation_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/invitations/:invitation_id" - }, - deleteRelease: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - release_id: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/:release_id" - }, - deleteReleaseAsset: { - method: "DELETE", - params: { - asset_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" - }, - disableAutomatedSecurityFixes: { - headers: { - accept: "application/vnd.github.london-preview+json" - }, - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/automated-security-fixes" - }, - disablePagesSite: { - headers: { - accept: "application/vnd.github.switcheroo-preview+json" - }, - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages" - }, - disableVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/vulnerability-alerts" - }, - enableAutomatedSecurityFixes: { - headers: { - accept: "application/vnd.github.london-preview+json" - }, - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/automated-security-fixes" - }, - enablePagesSite: { - headers: { - accept: "application/vnd.github.switcheroo-preview+json" - }, - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - source: { - type: "object" - }, - "source.branch": { - enum: ["master", "gh-pages"], - type: "string" - }, - "source.path": { - type: "string" - } - }, - url: "/repos/:owner/:repo/pages" - }, - enableVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/vulnerability-alerts" - }, - get: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo" - }, - getAppsWithAccessToProtectedBranch: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" - }, - getArchiveLink: { - method: "GET", - params: { - archive_format: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/:archive_format/:ref" - }, - getBranch: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch" - }, - getBranchProtection: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection" - }, - getClones: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - per: { - enum: ["day", "week"], - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/traffic/clones" - }, - getCodeFrequencyStats: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stats/code_frequency" - }, - getCollaboratorPermissionLevel: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/collaborators/:username/permission" - }, - getCombinedStatusForRef: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref/status" - }, - getCommit: { - method: "GET", - params: { - commit_sha: { - alias: "ref", - deprecated: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - alias: "ref", - deprecated: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref" - }, - getCommitActivityStats: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stats/commit_activity" - }, - getCommitComment: { - method: "GET", - params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments/:comment_id" - }, - getCommitRefSha: { - deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit", - headers: { - accept: "application/vnd.github.v3.sha" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref" - }, - getContents: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - ref: { - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/contents/:path" - }, - getContributorsStats: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stats/contributors" - }, - getDeployKey: { - method: "GET", - params: { - key_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/keys/:key_id" - }, - getDeployment: { - method: "GET", - params: { - deployment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/deployments/:deployment_id" - }, - getDeploymentStatus: { - method: "GET", - params: { - deployment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - status_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id" - }, - getDownload: { - method: "GET", - params: { - download_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/downloads/:download_id" - }, - getHook: { - method: "GET", - params: { - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks/:hook_id" - }, - getLatestPagesBuild: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages/builds/latest" - }, - getLatestRelease: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/latest" - }, - getPages: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages" - }, - getPagesBuild: { - method: "GET", - params: { - build_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages/builds/:build_id" - }, - getParticipationStats: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stats/participation" - }, - getProtectedBranchAdminEnforcement: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" - }, - getProtectedBranchPullRequestReviewEnforcement: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" - }, - getProtectedBranchRequiredSignatures: { - headers: { - accept: "application/vnd.github.zzzax-preview+json" - }, - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" - }, - getProtectedBranchRequiredStatusChecks: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" - }, - getProtectedBranchRestrictions: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" - }, - getPunchCardStats: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/stats/punch_card" - }, - getReadme: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - ref: { - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/readme" - }, - getRelease: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - release_id: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/:release_id" - }, - getReleaseAsset: { - method: "GET", - params: { - asset_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" - }, - getReleaseByTag: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - tag: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/tags/:tag" - }, - getTeamsWithAccessToProtectedBranch: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - getTopPaths: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/traffic/popular/paths" - }, - getTopReferrers: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/traffic/popular/referrers" - }, - getUsersWithAccessToProtectedBranch: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - getViews: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - per: { - enum: ["day", "week"], - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/traffic/views" - }, - list: { - method: "GET", - params: { - affiliation: { - type: "string" - }, - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated", "pushed", "full_name"], - type: "string" - }, - type: { - enum: ["all", "owner", "public", "private", "member"], - type: "string" - }, - visibility: { - enum: ["all", "public", "private"], - type: "string" - } - }, - url: "/user/repos" - }, - listAppsWithAccessToProtectedBranch: { - deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)", - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" - }, - listAssetsForRelease: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - release_id: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/:release_id/assets" - }, - listBranches: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - protected: { - type: "boolean" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches" - }, - listBranchesForHeadCommit: { - headers: { - accept: "application/vnd.github.groot-preview+json" - }, - method: "GET", - params: { - commit_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head" - }, - listCollaborators: { - method: "GET", - params: { - affiliation: { - enum: ["outside", "direct", "all"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/collaborators" - }, - listCommentsForCommit: { - method: "GET", - params: { - commit_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - alias: "commit_sha", - deprecated: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:commit_sha/comments" - }, - listCommitComments: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments" - }, - listCommits: { - method: "GET", - params: { - author: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - path: { - type: "string" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - }, - since: { - type: "string" - }, - until: { - type: "string" - } - }, - url: "/repos/:owner/:repo/commits" - }, - listContributors: { - method: "GET", - params: { - anon: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/contributors" - }, - listDeployKeys: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/keys" - }, - listDeploymentStatuses: { - method: "GET", - params: { - deployment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" - }, - listDeployments: { - method: "GET", - params: { - environment: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - }, - task: { - type: "string" - } - }, - url: "/repos/:owner/:repo/deployments" - }, - listDownloads: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/downloads" - }, - listForOrg: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated", "pushed", "full_name"], - type: "string" - }, - type: { - enum: ["all", "public", "private", "forks", "sources", "member", "internal"], - type: "string" - } - }, - url: "/orgs/:org/repos" - }, - listForUser: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated", "pushed", "full_name"], - type: "string" - }, - type: { - enum: ["all", "owner", "member"], - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/repos" - }, - listForks: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - sort: { - enum: ["newest", "oldest", "stargazers"], - type: "string" - } - }, - url: "/repos/:owner/:repo/forks" - }, - listHooks: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks" - }, - listInvitations: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/invitations" - }, - listInvitationsForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/repository_invitations" - }, - listLanguages: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/languages" - }, - listPagesBuilds: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages/builds" - }, - listProtectedBranchRequiredStatusChecksContexts: { - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" - }, - listProtectedBranchTeamRestrictions: { - deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)", - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - listProtectedBranchUserRestrictions: { - deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)", - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - listPublic: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "integer" - } - }, - url: "/repositories" - }, - listPullRequestsAssociatedWithCommit: { - headers: { - accept: "application/vnd.github.groot-preview+json" - }, - method: "GET", - params: { - commit_sha: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:commit_sha/pulls" - }, - listReleases: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases" - }, - listStatusesForRef: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - ref: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/commits/:ref/statuses" - }, - listTags: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/tags" - }, - listTeams: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/teams" - }, - listTeamsWithAccessToProtectedBranch: { - deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)", - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - listTopics: { - headers: { - accept: "application/vnd.github.mercy-preview+json" - }, - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/topics" - }, - listUsersWithAccessToProtectedBranch: { - deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)", - method: "GET", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - merge: { - method: "POST", - params: { - base: { - required: true, - type: "string" - }, - commit_message: { - type: "string" - }, - head: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/merges" - }, - pingHook: { - method: "POST", - params: { - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks/:hook_id/pings" - }, - removeBranchProtection: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection" - }, - removeCollaborator: { - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/collaborators/:username" - }, - removeDeployKey: { - method: "DELETE", - params: { - key_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/keys/:key_id" - }, - removeProtectedBranchAdminEnforcement: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" - }, - removeProtectedBranchAppRestrictions: { - method: "DELETE", - params: { - apps: { - mapTo: "data", - required: true, - type: "string[]" - }, - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" - }, - removeProtectedBranchPullRequestReviewEnforcement: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" - }, - removeProtectedBranchRequiredSignatures: { - headers: { - accept: "application/vnd.github.zzzax-preview+json" - }, - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" - }, - removeProtectedBranchRequiredStatusChecks: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" - }, - removeProtectedBranchRequiredStatusChecksContexts: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" - }, - removeProtectedBranchRestrictions: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" - }, - removeProtectedBranchTeamRestrictions: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - teams: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - removeProtectedBranchUserRestrictions: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - users: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - replaceProtectedBranchAppRestrictions: { - method: "PUT", - params: { - apps: { - mapTo: "data", - required: true, - type: "string[]" - }, - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" - }, - replaceProtectedBranchRequiredStatusChecksContexts: { - method: "PUT", - params: { - branch: { - required: true, - type: "string" - }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" - }, - replaceProtectedBranchTeamRestrictions: { - method: "PUT", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - teams: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" - }, - replaceProtectedBranchUserRestrictions: { - method: "PUT", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - users: { - mapTo: "data", - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" - }, - replaceTopics: { - headers: { - accept: "application/vnd.github.mercy-preview+json" - }, - method: "PUT", - params: { - names: { - required: true, - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/topics" - }, - requestPageBuild: { - method: "POST", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/pages/builds" - }, - retrieveCommunityProfileMetrics: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/community/profile" - }, - testPushHook: { - method: "POST", - params: { - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks/:hook_id/tests" - }, - transfer: { - method: "POST", - params: { - new_owner: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_ids: { - type: "integer[]" - } - }, - url: "/repos/:owner/:repo/transfer" - }, - update: { - method: "PATCH", - params: { - allow_merge_commit: { - type: "boolean" - }, - allow_rebase_merge: { - type: "boolean" - }, - allow_squash_merge: { - type: "boolean" - }, - archived: { - type: "boolean" - }, - default_branch: { - type: "string" - }, - delete_branch_on_merge: { - type: "boolean" - }, - description: { - type: "string" - }, - has_issues: { - type: "boolean" - }, - has_projects: { - type: "boolean" - }, - has_wiki: { - type: "boolean" - }, - homepage: { - type: "string" - }, - is_template: { - type: "boolean" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - repo: { - required: true, - type: "string" - }, - visibility: { - enum: ["public", "private", "visibility", "internal"], - type: "string" - } - }, - url: "/repos/:owner/:repo" - }, - updateBranchProtection: { - method: "PUT", - params: { - allow_deletions: { - type: "boolean" - }, - allow_force_pushes: { - allowNull: true, - type: "boolean" - }, - branch: { - required: true, - type: "string" - }, - enforce_admins: { - allowNull: true, - required: true, - type: "boolean" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - required_linear_history: { - type: "boolean" - }, - required_pull_request_reviews: { - allowNull: true, - required: true, - type: "object" - }, - "required_pull_request_reviews.dismiss_stale_reviews": { - type: "boolean" - }, - "required_pull_request_reviews.dismissal_restrictions": { - type: "object" - }, - "required_pull_request_reviews.dismissal_restrictions.teams": { - type: "string[]" - }, - "required_pull_request_reviews.dismissal_restrictions.users": { - type: "string[]" - }, - "required_pull_request_reviews.require_code_owner_reviews": { - type: "boolean" - }, - "required_pull_request_reviews.required_approving_review_count": { - type: "integer" - }, - required_status_checks: { - allowNull: true, - required: true, - type: "object" - }, - "required_status_checks.contexts": { - required: true, - type: "string[]" - }, - "required_status_checks.strict": { - required: true, - type: "boolean" - }, - restrictions: { - allowNull: true, - required: true, - type: "object" - }, - "restrictions.apps": { - type: "string[]" - }, - "restrictions.teams": { - required: true, - type: "string[]" - }, - "restrictions.users": { - required: true, - type: "string[]" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection" - }, - updateCommitComment: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/comments/:comment_id" - }, - updateFile: { - deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", - method: "PUT", - params: { - author: { - type: "object" - }, - "author.email": { - required: true, - type: "string" - }, - "author.name": { - required: true, - type: "string" - }, - branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { - required: true, - type: "string" - }, - "committer.name": { - required: true, - type: "string" - }, - content: { - required: true, - type: "string" - }, - message: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - path: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - sha: { - type: "string" - } - }, - url: "/repos/:owner/:repo/contents/:path" - }, - updateHook: { - method: "PATCH", - params: { - active: { - type: "boolean" - }, - add_events: { - type: "string[]" - }, - config: { - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { - type: "string" - }, - "config.secret": { - type: "string" - }, - "config.url": { - required: true, - type: "string" - }, - events: { - type: "string[]" - }, - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - remove_events: { - type: "string[]" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/hooks/:hook_id" - }, - updateInformationAboutPagesSite: { - method: "PUT", - params: { - cname: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - source: { - enum: ['"gh-pages"', '"master"', '"master /docs"'], - type: "string" - } - }, - url: "/repos/:owner/:repo/pages" - }, - updateInvitation: { - method: "PATCH", - params: { - invitation_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - permissions: { - enum: ["read", "write", "admin"], - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/invitations/:invitation_id" - }, - updateProtectedBranchPullRequestReviewEnforcement: { - method: "PATCH", - params: { - branch: { - required: true, - type: "string" - }, - dismiss_stale_reviews: { - type: "boolean" - }, - dismissal_restrictions: { - type: "object" - }, - "dismissal_restrictions.teams": { - type: "string[]" - }, - "dismissal_restrictions.users": { - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - require_code_owner_reviews: { - type: "boolean" - }, - required_approving_review_count: { - type: "integer" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" - }, - updateProtectedBranchRequiredStatusChecks: { - method: "PATCH", - params: { - branch: { - required: true, - type: "string" - }, - contexts: { - type: "string[]" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - strict: { - type: "boolean" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" - }, - updateRelease: { - method: "PATCH", - params: { - body: { - type: "string" - }, - draft: { - type: "boolean" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - prerelease: { - type: "boolean" - }, - release_id: { - required: true, - type: "integer" - }, - repo: { - required: true, - type: "string" - }, - tag_name: { - type: "string" - }, - target_commitish: { - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/:release_id" - }, - updateReleaseAsset: { - method: "PATCH", - params: { - asset_id: { - required: true, - type: "integer" - }, - label: { - type: "string" - }, - name: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" - }, - uploadReleaseAsset: { - method: "POST", - params: { - data: { - mapTo: "data", - required: true, - type: "string | object" - }, - file: { - alias: "data", - deprecated: true, - type: "string | object" - }, - headers: { - required: true, - type: "object" - }, - "headers.content-length": { - required: true, - type: "integer" - }, - "headers.content-type": { - required: true, - type: "string" - }, - label: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - url: { - required: true, - type: "string" - } - }, - url: ":url" - } - }, - search: { - code: { - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["indexed"], - type: "string" - } - }, - url: "/search/code" - }, - commits: { - headers: { - accept: "application/vnd.github.cloak-preview+json" - }, - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["author-date", "committer-date"], - type: "string" - } - }, - url: "/search/commits" - }, - issues: { - deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)", - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"], - type: "string" - } - }, - url: "/search/issues" - }, - issuesAndPullRequests: { - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"], - type: "string" - } - }, - url: "/search/issues" - }, - labels: { - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - q: { - required: true, - type: "string" - }, - repository_id: { - required: true, - type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" - } - }, - url: "/search/labels" - }, - repos: { - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["stars", "forks", "help-wanted-issues", "updated"], - type: "string" - } - }, - url: "/search/repositories" - }, - topics: { - method: "GET", - params: { - q: { - required: true, - type: "string" - } - }, - url: "/search/topics" - }, - users: { - method: "GET", - params: { - order: { - enum: ["desc", "asc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - q: { - required: true, - type: "string" - }, - sort: { - enum: ["followers", "repositories", "joined"], - type: "string" - } - }, - url: "/search/users" - } - }, - teams: { - addMember: { - deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)", - method: "PUT", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/members/:username" - }, - addMemberLegacy: { - deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy", - method: "PUT", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/members/:username" - }, - addOrUpdateMembership: { - deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)", - method: "PUT", - params: { - role: { - enum: ["member", "maintainer"], - type: "string" - }, - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/memberships/:username" - }, - addOrUpdateMembershipInOrg: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - role: { - enum: ["member", "maintainer"], - type: "string" - }, - team_slug: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/memberships/:username" - }, - addOrUpdateMembershipLegacy: { - deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy", - method: "PUT", - params: { - role: { - enum: ["member", "maintainer"], - type: "string" - }, - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/memberships/:username" - }, - addOrUpdateProject: { - deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PUT", - params: { - permission: { - enum: ["read", "write", "admin"], - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/projects/:project_id" - }, - addOrUpdateProjectInOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - permission: { - enum: ["read", "write", "admin"], - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/projects/:project_id" - }, - addOrUpdateProjectLegacy: { - deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PUT", - params: { - permission: { - enum: ["read", "write", "admin"], - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/projects/:project_id" - }, - addOrUpdateRepo: { - deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)", - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - addOrUpdateRepoInOrg: { - method: "PUT", - params: { - org: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" - }, - addOrUpdateRepoLegacy: { - deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy", - method: "PUT", - params: { - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - checkManagesRepo: { - deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)", - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - checkManagesRepoInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" - }, - checkManagesRepoLegacy: { - deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy", - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - create: { - method: "POST", - params: { - description: { - type: "string" - }, - maintainers: { - type: "string[]" - }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - }, - parent_team_id: { - type: "integer" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - privacy: { - enum: ["secret", "closed"], - type: "string" - }, - repo_names: { - type: "string[]" - } - }, - url: "/orgs/:org/teams" - }, - createDiscussion: { - deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)", - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_id: { - required: true, - type: "integer" - }, - title: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/discussions" - }, - createDiscussionComment: { - deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)", - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments" - }, - createDiscussionCommentInOrg: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments" - }, - createDiscussionCommentLegacy: { - deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy", - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments" - }, - createDiscussionInOrg: { - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_slug: { - required: true, - type: "string" - }, - title: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions" - }, - createDiscussionLegacy: { - deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy", - method: "POST", - params: { - body: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_id: { - required: true, - type: "integer" - }, - title: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/discussions" - }, - delete: { - deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id" - }, - deleteDiscussion: { - deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)", - method: "DELETE", - params: { - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - deleteDiscussionComment: { - deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)", - method: "DELETE", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - deleteDiscussionCommentInOrg: { - method: "DELETE", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" - }, - deleteDiscussionCommentLegacy: { - deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy", - method: "DELETE", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - deleteDiscussionInOrg: { - method: "DELETE", - params: { - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number" - }, - deleteDiscussionLegacy: { - deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy", - method: "DELETE", - params: { - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - deleteInOrg: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug" - }, - deleteLegacy: { - deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id" - }, - get: { - deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id" - }, - getByName: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug" - }, - getDiscussion: { - deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)", - method: "GET", - params: { - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - getDiscussionComment: { - deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)", - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - getDiscussionCommentInOrg: { - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" - }, - getDiscussionCommentLegacy: { - deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy", - method: "GET", - params: { - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - getDiscussionInOrg: { - method: "GET", - params: { - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number" - }, - getDiscussionLegacy: { - deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy", - method: "GET", - params: { - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - getLegacy: { - deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id" - }, - getMember: { - deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/members/:username" - }, - getMemberLegacy: { - deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/members/:username" - }, - getMembership: { - deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/memberships/:username" - }, - getMembershipInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/memberships/:username" - }, - getMembershipLegacy: { - deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy", - method: "GET", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/teams/:team_id/memberships/:username" - }, - list: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/orgs/:org/teams" - }, - listChild: { - deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/teams" - }, - listChildInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/teams" - }, - listChildLegacy: { - deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/teams" - }, - listDiscussionComments: { - deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)", - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments" - }, - listDiscussionCommentsInOrg: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments" - }, - listDiscussionCommentsLegacy: { - deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy", - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments" - }, - listDiscussions: { - deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)", - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions" - }, - listDiscussionsInOrg: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/discussions" - }, - listDiscussionsLegacy: { - deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy", - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/discussions" - }, - listForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/teams" - }, - listMembers: { - deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - role: { - enum: ["member", "maintainer", "all"], - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/members" - }, - listMembersInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - role: { - enum: ["member", "maintainer", "all"], - type: "string" - }, - team_slug: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/teams/:team_slug/members" - }, - listMembersLegacy: { - deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - role: { - enum: ["member", "maintainer", "all"], - type: "string" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/members" - }, - listPendingInvitations: { - deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" - } - }, - url: "/teams/:team_id/invitations" - }, - listPendingInvitationsInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } } - }, - url: "/orgs/:org/teams/:team_slug/invitations" - }, - listPendingInvitationsLegacy: { - deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + async getJson(requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + let res = await this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async postJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async putJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async patchJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + async request(verb, requestUrl, data, headers) { + if (this._disposed) { + throw new Error('Client has already been disposed.'); } - }, - url: "/teams/:team_id/invitations" - }, - listProjects: { - deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + let parsedUrl = url.parse(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + response = await this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = url.parse(redirectUrl); + if (parsedUrl.protocol == 'https:' && + parsedUrl.protocol != parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + await response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (let header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = await this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + await response.readBody(); + await this._performExponentialBackoff(numTries); + } } - }, - url: "/teams/:team_id/projects" - }, - listProjectsInOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" + return response; + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } - }, - url: "/orgs/:org/teams/:team_slug/projects" - }, - listProjectsLegacy: { - deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof data === 'string') { + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } - }, - url: "/teams/:team_id/projects" - }, - listRepos: { - deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); + }); + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); } - }, - url: "/teams/:team_id/repos" - }, - listReposInOrg: { - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, - type: "string" + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); } - }, - url: "/orgs/:org/teams/:team_slug/repos" - }, - listReposLegacy: { - deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy", - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + else { + req.end(); } - }, - url: "/teams/:team_id/repos" - }, - removeMember: { - deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + let parsedUrl = url.parse(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; } - }, - url: "/teams/:team_id/members/:username" - }, - removeMemberLegacy: { - deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + this.handlers.forEach(handler => { + handler.prepareRequest(info.options); + }); } - }, - url: "/teams/:team_id/members/:username" - }, - removeMembership: { - deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" + return info; + } + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); } - }, - url: "/teams/:team_id/memberships/:username" - }, - removeMembershipInOrg: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - }, - url: "/orgs/:org/teams/:team_slug/memberships/:username" - }, - removeMembershipLegacy: { - deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy", - method: "DELETE", - params: { - team_id: { - required: true, - type: "integer" - }, - username: { - required: true, - type: "string" + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + let proxyUrl = pm.getProxyUrl(parsedUrl); + let useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - }, - url: "/teams/:team_id/memberships/:username" - }, - removeProject: { - deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)", - method: "DELETE", - params: { - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + if (this._keepAlive && !useProxy) { + agent = this._agent; } - }, - url: "/teams/:team_id/projects/:project_id" - }, - removeProjectInOrg: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - team_slug: { - required: true, - type: "string" + // if agent is already assigned use that agent. + if (!!agent) { + return agent; } - }, - url: "/orgs/:org/teams/:team_slug/projects/:project_id" - }, - removeProjectLegacy: { - deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy", - method: "DELETE", - params: { - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - }, - url: "/teams/:team_id/projects/:project_id" - }, - removeRepo: { - deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)", - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __webpack_require__(413); + } + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + proxyAuth: proxyUrl.auth, + host: proxyUrl.hostname, + port: proxyUrl.port + } + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - removeRepoInOrg: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; } - }, - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" - }, - removeRepoLegacy: { - deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy", - method: "DELETE", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - }, - team_id: { - required: true, - type: "integer" + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; } - }, - url: "/teams/:team_id/repos/:owner/:repo" - }, - reviewProject: { - deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - }, - url: "/teams/:team_id/projects/:project_id" - }, - reviewProjectInOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - org: { - required: true, - type: "string" - }, - project_id: { - required: true, - type: "integer" - }, - team_slug: { - required: true, - type: "string" + return agent; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } } - }, - url: "/orgs/:org/teams/:team_slug/projects/:project_id" - }, - reviewProjectLegacy: { - deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "GET", - params: { - project_id: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + return value; + } + async _processResponse(res, options) { + return new Promise(async (resolve, reject) => { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = await res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = 'Failed request: (' + statusCode + ')'; + } + let err = new Error(msg); + // attach statusCode and body obj (if available) to the error object + err['statusCode'] = statusCode; + if (response.result) { + err['result'] = response.result; + } + reject(err); + } + else { + resolve(response); + } + }); + } +} +exports.HttpClient = HttpClient; + + +/***/ }), + +/***/ 542: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +const path = __webpack_require__(622); +const which = __webpack_require__(55); +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 */ } - }, - url: "/teams/:team_id/projects/:project_id" - }, - update: { - deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)", - method: "PATCH", - params: { - description: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - parent_team_id: { - type: "integer" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - privacy: { - enum: ["secret", "closed"], - type: "string" - }, - team_id: { - required: true, - type: "integer" + } + + 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; + + +/***/ }), + +/***/ 562: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; + } + + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + } + + return ""; +} + +exports.getUserAgent = getUserAgent; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 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'; +}; + + +/***/ }), + +/***/ 605: +/***/ (function(module) { + +module.exports = require("http"); + +/***/ }), + +/***/ 607: +/***/ (function(module, exports) { + +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var R = 0 + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++ +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' +var NUMERICIDENTIFIERLOOSE = R++ +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++ +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++ +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')' + +var MAINVERSIONLOOSE = R++ +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++ +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +var PRERELEASEIDENTIFIERLOOSE = R++ +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++ +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' + +var PRERELEASELOOSE = R++ +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++ +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++ +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++ +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?' + +src[FULL] = '^' + FULLPLAIN + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?' + +var LOOSE = R++ +src[LOOSE] = '^' + LOOSEPLAIN + '$' + +var GTLT = R++ +src[GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++ +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +var XRANGEIDENTIFIER = R++ +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' + +var XRANGEPLAIN = R++ +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGEPLAINLOOSE = R++ +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGE = R++ +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' +var XRANGELOOSE = R++ +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +var COERCE = R++ +src[COERCE] = '(?:^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++ +src[LONETILDE] = '(?:~>?)' + +var TILDETRIM = R++ +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +var tildeTrimReplace = '$1~' + +var TILDE = R++ +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' +var TILDELOOSE = R++ +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++ +src[LONECARET] = '(?:\\^)' + +var CARETTRIM = R++ +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +var caretTrimReplace = '$1^' + +var CARET = R++ +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' +var CARETLOOSE = R++ +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++ +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' +var COMPARATOR = R++ +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++ +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++ +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$' + +var HYPHENRANGELOOSE = R++ +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +var STAR = R++ +src[STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? re[LOOSE] : re[FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num } - }, - url: "/teams/:team_id" - }, - updateDiscussion: { - deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)", - method: "PATCH", - params: { - body: { - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - }, - title: { - type: "string" + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - updateDiscussionComment: { - deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)", - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - updateDiscussionCommentInOrg: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" - }, - updateDiscussionCommentLegacy: { - deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy", - method: "PATCH", - params: { - body: { - required: true, - type: "string" - }, - comment_number: { - required: true, - type: "integer" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key } - }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" - }, - updateDiscussionInOrg: { - method: "PATCH", - params: { - body: { - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - }, - title: { - type: "string" + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compare(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.rcompare(a, b, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY) { + return true + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return thisComparators.every(function (thisComparator) { + return range.set.some(function (rangeComparators) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + }) + }) +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? re[TILDELOOSE] : re[TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[CARETLOOSE] : re[CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' } - }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number" - }, - updateDiscussionLegacy: { - deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy", - method: "PATCH", - params: { - body: { - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { - required: true, - type: "integer" - }, - title: { - type: "string" + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' } - }, - url: "/teams/:team_id/discussions/:discussion_number" - }, - updateInOrg: { - method: "PATCH", - params: { - description: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - }, - parent_team_id: { - type: "integer" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - privacy: { - enum: ["secret", "closed"], - type: "string" - }, - team_slug: { - required: true, - type: "string" + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 } - }, - url: "/orgs/:org/teams/:team_slug" - }, - updateLegacy: { - deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy", - method: "PATCH", - params: { - description: { - type: "string" - }, - name: { - required: true, - type: "string" - }, - parent_team_id: { - type: "integer" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - privacy: { - enum: ["secret", "closed"], - type: "string" - }, - team_id: { - required: true, - type: "integer" + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], '') +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true } - }, - url: "/teams/:team_id" + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false } - }, - users: { - addEmails: { - method: "POST", - params: { - emails: { - required: true, - type: "string[]" - } - }, - url: "/user/emails" - }, - block: { - method: "PUT", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/blocks/:username" - }, - checkBlocked: { - method: "GET", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/blocks/:username" - }, - checkFollowing: { - method: "GET", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/following/:username" - }, - checkFollowingForUser: { - method: "GET", - params: { - target_user: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/following/:target_user" - }, - createGpgKey: { - method: "POST", - params: { - armored_public_key: { - type: "string" - } - }, - url: "/user/gpg_keys" - }, - createPublicKey: { - method: "POST", - params: { - key: { - type: "string" - }, - title: { - type: "string" - } - }, - url: "/user/keys" - }, - deleteEmails: { - method: "DELETE", - params: { - emails: { - required: true, - type: "string[]" - } - }, - url: "/user/emails" - }, - deleteGpgKey: { - method: "DELETE", - params: { - gpg_key_id: { - required: true, - type: "integer" - } - }, - url: "/user/gpg_keys/:gpg_key_id" - }, - deletePublicKey: { - method: "DELETE", - params: { - key_id: { - required: true, - type: "integer" - } - }, - url: "/user/keys/:key_id" - }, - follow: { - method: "PUT", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/following/:username" - }, - getAuthenticated: { - method: "GET", - params: {}, - url: "/user" - }, - getByUsername: { - method: "GET", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/users/:username" - }, - getContextForUser: { - method: "GET", - params: { - subject_id: { - type: "string" - }, - subject_type: { - enum: ["organization", "repository", "issue", "pull_request"], - type: "string" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/hovercard" - }, - getGpgKey: { - method: "GET", - params: { - gpg_key_id: { - required: true, - type: "integer" - } - }, - url: "/user/gpg_keys/:gpg_key_id" - }, - getPublicKey: { - method: "GET", - params: { - key_id: { - required: true, - type: "integer" - } - }, - url: "/user/keys/:key_id" - }, - list: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { - type: "string" - } - }, - url: "/users" - }, - listBlocked: { - method: "GET", - params: {}, - url: "/user/blocks" - }, - listEmails: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/emails" - }, - listFollowersForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/followers" - }, - listFollowersForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/followers" - }, - listFollowingForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/following" - }, - listFollowingForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/following" - }, - listGpgKeys: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/gpg_keys" - }, - listGpgKeysForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/gpg_keys" - }, - listPublicEmails: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/public_emails" - }, - listPublicKeys: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - } - }, - url: "/user/keys" - }, - listPublicKeysForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" - } - }, - url: "/users/:username/keys" - }, - togglePrimaryEmailVisibility: { - method: "PATCH", - params: { - email: { - required: true, - type: "string" - }, - visibility: { - required: true, - type: "string" - } - }, - url: "/user/email/visibility" - }, - unblock: { - method: "DELETE", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/blocks/:username" - }, - unfollow: { - method: "DELETE", - params: { - username: { - required: true, - type: "string" - } - }, - url: "/user/following/:username" - }, - updateAuthenticated: { - method: "PATCH", - params: { - bio: { - type: "string" - }, - blog: { - type: "string" - }, - company: { - type: "string" - }, - email: { - type: "string" - }, - hireable: { - type: "boolean" - }, - location: { - type: "string" - }, - name: { - type: "string" - } - }, - url: "/user" + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version) { + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + var match = version.match(re[COERCE]) + + if (match == null) { + return null + } + + return parse(match[1] + + '.' + (match[2] || '0') + + '.' + (match[3] || '0')) +} + + +/***/ }), + +/***/ 614: +/***/ (function(module) { + +module.exports = require("events"); + +/***/ }), + +/***/ 621: +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + +const path = __webpack_require__(622); +const pathKey = __webpack_require__(682); + +module.exports = opts => { + opts = Object.assign({ + cwd: process.cwd(), + path: process.env[pathKey()] + }, opts); + + let prev; + let pth = path.resolve(opts.cwd); + const ret = []; + + while (prev !== pth) { + ret.push(path.join(pth, 'node_modules/.bin')); + prev = pth; + pth = path.resolve(pth, '..'); + } + + // ensure the running `node` binary is used + ret.push(path.dirname(process.execPath)); + + return ret.concat(opts.path).join(path.delimiter); +}; + +module.exports.env = opts => { + opts = Object.assign({ + env: process.env + }, opts); + + const env = Object.assign({}, opts.env); + const path = pathKey({env}); + + opts.path = env[path]; + env[path] = module.exports(opts); + + return env; +}; + + +/***/ }), + +/***/ 622: +/***/ (function(module) { + +module.exports = require("path"); + +/***/ }), + +/***/ 631: +/***/ (function(module) { + +module.exports = require("net"); + +/***/ }), + +/***/ 654: +/***/ (function(module) { + +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} + + +/***/ }), + +/***/ 669: +/***/ (function(module) { + +module.exports = require("util"); + +/***/ }), + +/***/ 682: +/***/ (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'; +}; + + +/***/ }), + +/***/ 692: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } + + this.name = 'Deprecation'; + } + +} + +exports.Deprecation = Deprecation; + + +/***/ }), + +/***/ 696: +/***/ (function(module) { + +"use strict"; + + +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +} + +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObjectObject(o) { + return isObject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; } + + // Most likely a plain Object + return true; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ 697: +/***/ (function(module) { + +"use strict"; + +module.exports = (promise, onFinally) => { + onFinally = onFinally || (() => {}); + + return promise.then( + val => new Promise(resolve => { + resolve(onFinally()); + }).then(() => val), + err => new Promise(resolve => { + resolve(onFinally()); + }).then(() => { + throw err; + }) + ); }; -const VERSION = "2.4.0"; -function registerEndpoints(octokit, routes) { - Object.keys(routes).forEach(namespaceName => { - if (!octokit[namespaceName]) { - octokit[namespaceName] = {}; +/***/ }), + +/***/ 742: +/***/ (function(module, __unusedexports, __webpack_require__) { + +var fs = __webpack_require__(747) +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = __webpack_require__(818) +} else { + core = __webpack_require__(197) +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') } - Object.keys(routes[namespaceName]).forEach(apiName => { - const apiOptions = routes[namespaceName][apiName]; - const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => { - if (typeof apiOptions[key] !== "undefined") { - map[key] = apiOptions[key]; + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) } + }) + }) + } - return map; - }, {}); - endpointDefaults.request = { - validate: apiOptions.params - }; - let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters. - // Not the most elegant solution, but we don’t want to move deprecation - // logic into octokit/endpoint.js as it’s out of scope - - const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated); - - if (hasDeprecatedParam) { - const patch = patchForDeprecation.bind(null, octokit, apiOptions); - request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`); - request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`); - request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`); + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false } + } + cb(er, is) + }) +} - if (apiOptions.deprecated) { - octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() { - octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)); - octokit[namespaceName][apiName] = request; - return request.apply(null, arguments); - }, request); - return; - } +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} + + +/***/ }), + +/***/ 747: +/***/ (function(module) { - octokit[namespaceName][apiName] = request; - }); - }); -} +module.exports = require("fs"); -function patchForDeprecation(octokit, apiOptions, method, methodName) { - const patchedMethod = options => { - options = Object.assign({}, options); - Object.keys(options).forEach(key => { - if (apiOptions.params[key] && apiOptions.params[key].deprecated) { - const aliasKey = apiOptions.params[key].alias; - octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`)); +/***/ }), - if (!(aliasKey in options)) { - options[aliasKey] = options[key]; - } +/***/ 753: +/***/ (function(__unusedmodule, exports, __webpack_require__) { - delete options[key]; - } - }); - return method(options); - }; +"use strict"; - Object.keys(method).forEach(key => { - patchedMethod[key] = method[key]; - }); - return patchedMethod; -} -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ +Object.defineProperty(exports, '__esModule', { value: true }); -function restEndpointMethods(octokit) { - // @ts-ignore - octokit.registerEndpoints = registerEndpoints.bind(null, octokit); - registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility - // See https://github.com/octokit/rest.js/pull/1134 +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => { - Object.defineProperty(octokit, deprecatedScope, { - get() { - octokit.log.warn( // @ts-ignore - new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore +var endpoint = __webpack_require__(385); +var universalUserAgent = __webpack_require__(392); +var isPlainObject = _interopDefault(__webpack_require__(696)); +var nodeFetch = _interopDefault(__webpack_require__(454)); +var requestError = __webpack_require__(463); - return octokit[scope]; - } +const VERSION = "5.4.6"; - }); - }); - return {}; +function getBufferResponse(response) { + return response.arrayBuffer(); } -restEndpointMethods.VERSION = VERSION; -exports.restEndpointMethods = restEndpointMethods; -//# sourceMappingURL=index.js.map +function fetchWrapper(requestOptions) { + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers = {}; + let status; + let url; + const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; + return fetch(requestOptions.url, Object.assign({ + method: requestOptions.method, + body: requestOptions.body, + headers: requestOptions.headers, + redirect: requestOptions.redirect + }, requestOptions.request)).then(response => { + url = response.url; + status = response.status; -/***/ }), + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; + } -/***/ 850: -/***/ (function(module, __unusedexports, __webpack_require__) { + if (status === 204 || status === 205) { + return; + } // GitHub API returns 200 for HEAD requests -module.exports = paginationMethodsPlugin -function paginationMethodsPlugin (octokit) { - octokit.getFirstPage = __webpack_require__(777).bind(null, octokit) - octokit.getLastPage = __webpack_require__(649).bind(null, octokit) - octokit.getNextPage = __webpack_require__(550).bind(null, octokit) - octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit) - octokit.hasFirstPage = __webpack_require__(536) - octokit.hasLastPage = __webpack_require__(336) - octokit.hasNextPage = __webpack_require__(929) - octokit.hasPreviousPage = __webpack_require__(558) -} + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } + throw new requestError.RequestError(response.statusText, status, { + headers, + request: requestOptions + }); + } -/***/ }), + if (status === 304) { + throw new requestError.RequestError("Not modified", status, { + headers, + request: requestOptions + }); + } -/***/ 854: -/***/ (function(module) { + if (status >= 400) { + return response.text().then(message => { + const error = new requestError.RequestError(message, status, { + headers, + request: requestOptions + }); -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ + try { + let responseBody = JSON.parse(error.message); + Object.assign(error, responseBody); + let errors = responseBody.errors; // Assumption `errors` would always be in Array format -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; + error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); + } catch (e) {// ignore, see octokit/rest.js#684 + } -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; + throw error; + }); + } -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; + const contentType = response.headers.get("content-type"); -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; + if (/application\/json/.test(contentType)) { + return response.json(); + } -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + return getBufferResponse(response); + }).then(data => { + return { + status, + url, + headers, + data + }; + }).catch(error => { + if (error instanceof requestError.RequestError) { + throw error; + } + + throw new requestError.RequestError(error.message, 500, { + headers, + request: requestOptions + }); + }); +} -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; +function withDefaults(oldEndpoint, newDefaults) { + const endpoint = oldEndpoint.defaults(newDefaults); -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; + const newApi = function (route, parameters) { + const endpointOptions = endpoint.merge(route, parameters); -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint.parse(endpointOptions)); + } -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + const request = (route, parameters) => { + return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); + }; -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); + Object.assign(request, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); + return endpointOptions.request.hook(request, endpointOptions); + }; -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; + return Object.assign(newApi, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); } -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} +const request = withDefaults(endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +}); -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +exports.request = request; +//# sourceMappingURL=index.js.map -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +/***/ }), -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +/***/ 759: +/***/ (function(module) { -/** Built-in value references. */ -var Symbol = root.Symbol, - splice = arrayProto.splice; +"use strict"; -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; + return arg; } -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} + // Algorithm below is based on https://qntm.org/cmd -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} + // 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'); -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; + // All other backslashes occur literally -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + // Quote the whole thing: + arg = `"${arg}"`; -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; + return arg; } -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; - return index < 0 ? undefined : data[index][1]; -} -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} +/***/ }), + +/***/ 761: +/***/ (function(module) { -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); +module.exports = require("zlib"); - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} +/***/ }), -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; +/***/ 768: +/***/ (function(module) { -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +"use strict"; -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} +module.exports = function (x) { + var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); + var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} + if (x[x.length - 1] === lf) { + x = x.slice(0, x.length - 1); + } -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} + if (x[x.length - 1] === cr) { + x = x.slice(0, x.length - 1); + } -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} + return x; +}; -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; +/***/ }), -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} +/***/ 774: +/***/ (function(module, __unusedexports, __webpack_require__) { -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); +"use strict"; - var index = 0, - length = path.length; - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} +const cp = __webpack_require__(129); +const parse = __webpack_require__(884); +const enoent = __webpack_require__(15); -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value) { - return isArray(value) ? value : stringToPath(value); -} + // 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); -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; + return spawned; } -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} + // 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); -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); + return result; } -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoize(function(string) { - string = toString(string); +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); +module.exports._parse = parse; +module.exports._enoent = enoent; -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} +/***/ }), -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; +/***/ 794: +/***/ (function(module) { - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} +module.exports = require("stream"); -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; +/***/ }), -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} +/***/ 796: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; +"use strict"; -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} +Object.defineProperty(exports, '__esModule', { value: true }); -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} +var osName = _interopDefault(__webpack_require__(2)); -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} +function getUserAgent() { + try { + return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`; + } catch (error) { + if (/wmic os get Caption/.test(error.message)) { + return "Windows "; + } -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; + return ""; + } } -module.exports = get; +exports.getUserAgent = getUserAgent; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 855: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 813: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +async function auth(token) { + const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; + return { + type: "token", + token: token, + tokenType + }; +} -module.exports = registerPlugin; +/** + * Prefix token for usage in the Authorization header + * + * @param token OAuth token or JSON Web Token + */ +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } -const factory = __webpack_require__(47); + return `token ${token}`; +} -function registerPlugin(plugins, pluginFunction) { - return factory( - plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction) - ); +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge(route, parameters); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); } +const createTokenAuth = function createTokenAuth(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } -/***/ }), + if (typeof token !== "string") { + throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); + } -/***/ 856: -/***/ (function(module, __unusedexports, __webpack_require__) { + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); +}; -module.exports = __webpack_require__(141); +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 863: +/***/ 818: /***/ (function(module, __unusedexports, __webpack_require__) { -module.exports = authenticationBeforeRequest; +module.exports = isexe +isexe.sync = sync -const btoa = __webpack_require__(675); +var fs = __webpack_require__(747) -const withAuthorizationPrefix = __webpack_require__(143); +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT -function authenticationBeforeRequest(state, options) { - if (typeof state.auth === "string") { - options.headers.authorization = withAuthorizationPrefix(state.auth); - return; + if (!pathext) { + return true } - if (state.auth.username) { - const hash = btoa(`${state.auth.username}:${state.auth.password}`); - options.headers.authorization = `Basic ${hash}`; - if (state.otp) { - options.headers["x-github-otp"] = state.otp; - } - return; + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true } - - if (state.auth.clientId) { - // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as - // Basic Authorization instead of query parameters. The only routes where that applies share the same - // URL though: `/applications/:client_id/tokens/:access_token`. - // - // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization) - // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization) - // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application) - // - // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token" - // as well as "/applications/123/tokens/token456" - if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) { - const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`); - options.headers.authorization = `Basic ${hash}`; - return; + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true } - - options.url += options.url.indexOf("?") === -1 ? "?" : "&"; - options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`; - return; } + return false +} - return Promise.resolve() +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} - .then(() => { - return state.auth(); - }) +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} - .then(authorization => { - options.headers.authorization = withAuthorizationPrefix(authorization); - }); +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) } /***/ }), -/***/ 866: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 835: +/***/ (function(module) { -"use strict"; +module.exports = require("url"); -var shebangRegex = __webpack_require__(816); +/***/ }), -module.exports = function (str) { - var match = str.match(shebangRegex); +/***/ 842: +/***/ (function(__unusedmodule, exports) { - if (!match) { - return null; - } +"use strict"; - var arr = match[0].replace(/#! ?/, '').split(' '); - var bin = arr[0].split('/').pop(); - var arg = arr[1]; - return (bin === 'env' ? - arg : - bin + (arg ? ' ' + arg : '') - ); +Object.defineProperty(exports, '__esModule', { value: true }); + +const Endpoints = { + actions: { + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], + createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], + deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], + deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], + deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], + downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], + downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], + getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], + listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", { + mediaType: { + previews: ["machine-man"] + } + }], + checkToken: ["POST /applications/{client_id}/token"], + createContentAttachment: ["POST /content_references/{content_reference_id}/attachments", { + mediaType: { + previews: ["corsair"] + } + }], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens", { + mediaType: { + previews: ["machine-man"] + } + }], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}", { + mediaType: { + previews: ["machine-man"] + } + }], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app", { + mediaType: { + previews: ["machine-man"] + } + }], + getBySlug: ["GET /apps/{app_slug}", { + mediaType: { + previews: ["machine-man"] + } + }], + getInstallation: ["GET /app/installations/{installation_id}", { + mediaType: { + previews: ["machine-man"] + } + }], + getOrgInstallation: ["GET /orgs/{org}/installation", { + mediaType: { + previews: ["machine-man"] + } + }], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation", { + mediaType: { + previews: ["machine-man"] + } + }], + getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], + getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], + getUserInstallation: ["GET /users/{username}/installation", { + mediaType: { + previews: ["machine-man"] + } + }], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], + listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories", { + mediaType: { + previews: ["machine-man"] + } + }], + listInstallations: ["GET /app/installations", { + mediaType: { + previews: ["machine-man"] + } + }], + listInstallationsForAuthenticatedUser: ["GET /user/installations", { + mediaType: { + previews: ["machine-man"] + } + }], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories", { + mediaType: { + previews: ["machine-man"] + } + }], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], + removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", { + mediaType: { + previews: ["machine-man"] + } + }], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs", { + mediaType: { + previews: ["antiope"] + } + }], + createSuite: ["POST /repos/{owner}/{repo}/check-suites", { + mediaType: { + previews: ["antiope"] + } + }], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}", { + mediaType: { + previews: ["antiope"] + } + }], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", { + mediaType: { + previews: ["antiope"] + } + }], + listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", { + mediaType: { + previews: ["antiope"] + } + }], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs", { + mediaType: { + previews: ["antiope"] + } + }], + listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", { + mediaType: { + previews: ["antiope"] + } + }], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites", { + mediaType: { + previews: ["antiope"] + } + }], + rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", { + mediaType: { + previews: ["antiope"] + } + }], + setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences", { + mediaType: { + previews: ["antiope"] + } + }], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", { + mediaType: { + previews: ["antiope"] + } + }] + }, + codeScanning: { + getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_id}"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"] + }, + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct", { + mediaType: { + previews: ["scarlet-witch"] + } + }], + getConductCode: ["GET /codes_of_conduct/{key}", { + mediaType: { + previews: ["scarlet-witch"] + } + }], + getForRepo: ["GET /repos/{owner}/{repo}/community/code_of_conduct", { + mediaType: { + previews: ["scarlet-witch"] + } + }] + }, + emojis: { + get: ["GET /emojis"] + }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] + }, + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] + }, + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] + }, + interactions: { + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }], + removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits", { + mediaType: { + previews: ["sombra"] + } + }] + }, + issues: { + addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", { + mediaType: { + previews: ["mockingbird"] + } + }], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], + removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: ["POST /markdown/raw", { + headers: { + "content-type": "text/plain; charset=utf-8" + } + }] + }, + meta: { + get: ["GET /meta"] + }, + migrations: { + cancelImport: ["DELETE /repos/{owner}/{repo}/import"], + deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive", { + mediaType: { + previews: ["wyandotte"] + } + }], + deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive", { + mediaType: { + previews: ["wyandotte"] + } + }], + downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive", { + mediaType: { + previews: ["wyandotte"] + } + }], + getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive", { + mediaType: { + previews: ["wyandotte"] + } + }], + getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], + getImportStatus: ["GET /repos/{owner}/{repo}/import"], + getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}", { + mediaType: { + previews: ["wyandotte"] + } + }], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}", { + mediaType: { + previews: ["wyandotte"] + } + }], + listForAuthenticatedUser: ["GET /user/migrations", { + mediaType: { + previews: ["wyandotte"] + } + }], + listForOrg: ["GET /orgs/{org}/migrations", { + mediaType: { + previews: ["wyandotte"] + } + }], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories", { + mediaType: { + previews: ["wyandotte"] + } + }], + listReposForUser: ["GET /user/{migration_id}/repositories", { + mediaType: { + previews: ["wyandotte"] + } + }], + mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], + setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: ["PUT /repos/{owner}/{repo}/import"], + unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock", { + mediaType: { + previews: ["wyandotte"] + } + }], + unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", { + mediaType: { + previews: ["wyandotte"] + } + }], + updateImport: ["PATCH /repos/{owner}/{repo}/import"] + }, + orgs: { + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], + createInvitation: ["POST /orgs/{org}/invitations"], + createWebhook: ["POST /orgs/{org}/hooks"], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + get: ["GET /orgs/{org}"], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations", { + mediaType: { + previews: ["machine-man"] + } + }], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhooks: ["GET /orgs/{org}/hooks"], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], + removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"] + }, + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}", { + mediaType: { + previews: ["inertia"] + } + }], + createCard: ["POST /projects/columns/{column_id}/cards", { + mediaType: { + previews: ["inertia"] + } + }], + createColumn: ["POST /projects/{project_id}/columns", { + mediaType: { + previews: ["inertia"] + } + }], + createForAuthenticatedUser: ["POST /user/projects", { + mediaType: { + previews: ["inertia"] + } + }], + createForOrg: ["POST /orgs/{org}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + createForRepo: ["POST /repos/{owner}/{repo}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + delete: ["DELETE /projects/{project_id}", { + mediaType: { + previews: ["inertia"] + } + }], + deleteCard: ["DELETE /projects/columns/cards/{card_id}", { + mediaType: { + previews: ["inertia"] + } + }], + deleteColumn: ["DELETE /projects/columns/{column_id}", { + mediaType: { + previews: ["inertia"] + } + }], + get: ["GET /projects/{project_id}", { + mediaType: { + previews: ["inertia"] + } + }], + getCard: ["GET /projects/columns/cards/{card_id}", { + mediaType: { + previews: ["inertia"] + } + }], + getColumn: ["GET /projects/columns/{column_id}", { + mediaType: { + previews: ["inertia"] + } + }], + getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission", { + mediaType: { + previews: ["inertia"] + } + }], + listCards: ["GET /projects/columns/{column_id}/cards", { + mediaType: { + previews: ["inertia"] + } + }], + listCollaborators: ["GET /projects/{project_id}/collaborators", { + mediaType: { + previews: ["inertia"] + } + }], + listColumns: ["GET /projects/{project_id}/columns", { + mediaType: { + previews: ["inertia"] + } + }], + listForOrg: ["GET /orgs/{org}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + listForRepo: ["GET /repos/{owner}/{repo}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + listForUser: ["GET /users/{username}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + moveCard: ["POST /projects/columns/cards/{card_id}/moves", { + mediaType: { + previews: ["inertia"] + } + }], + moveColumn: ["POST /projects/columns/{column_id}/moves", { + mediaType: { + previews: ["inertia"] + } + }], + removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}", { + mediaType: { + previews: ["inertia"] + } + }], + update: ["PATCH /projects/{project_id}", { + mediaType: { + previews: ["inertia"] + } + }], + updateCard: ["PATCH /projects/columns/cards/{card_id}", { + mediaType: { + previews: ["inertia"] + } + }], + updateColumn: ["PATCH /projects/columns/{column_id}", { + mediaType: { + previews: ["inertia"] + } + }] + }, + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch", { + mediaType: { + previews: ["lydian"] + } + }], + updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] + }, + rateLimit: { + get: ["GET /rate_limit"] + }, + reactions: { + createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], + listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }] + }, + repos: { + acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}"], + addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts", { + mediaType: { + previews: ["dorian"] + } + }], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { + mediaType: { + previews: ["zzzax"] + } + }], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages", { + mediaType: { + previews: ["switcheroo"] + } + }], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate", { + mediaType: { + previews: ["baptiste"] + } + }], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}"], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { + mediaType: { + previews: ["zzzax"] + } + }], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages", { + mediaType: { + previews: ["switcheroo"] + } + }], + deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes", { + mediaType: { + previews: ["london"] + } + }], + disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts", { + mediaType: { + previews: ["dorian"] + } + }], + downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], + enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes", { + mediaType: { + previews: ["london"] + } + }], + enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts", { + mediaType: { + previews: ["dorian"] + } + }], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], + getAllTopics: ["GET /repos/{owner}/{repo}/topics", { + mediaType: { + previews: ["mercy"] + } + }], + getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { + mediaType: { + previews: ["zzzax"] + } + }], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], + getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], + getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], + getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], + getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], + getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], + getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], + getPages: ["GET /repos/{owner}/{repo}/pages"], + getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], + getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], + getReadme: ["GET /repos/{owner}/{repo}/readme"], + getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], + getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], + getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], + getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], + getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], + getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], + getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], + getViews: ["GET /repos/{owner}/{repo}/traffic/views"], + getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + listBranches: ["GET /repos/{owner}/{repo}/branches"], + listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", { + mediaType: { + previews: ["groot"] + } + }], + listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], + listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], + listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], + listCommits: ["GET /repos/{owner}/{repo}/commits"], + listContributors: ["GET /repos/{owner}/{repo}/contributors"], + listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], + listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + listDeployments: ["GET /repos/{owner}/{repo}/deployments"], + listForAuthenticatedUser: ["GET /user/repos"], + listForOrg: ["GET /orgs/{org}/repos"], + listForUser: ["GET /users/{username}/repos"], + listForks: ["GET /repos/{owner}/{repo}/forks"], + listInvitations: ["GET /repos/{owner}/{repo}/invitations"], + listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], + listLanguages: ["GET /repos/{owner}/{repo}/languages"], + listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], + listPublic: ["GET /repositories"], + listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", { + mediaType: { + previews: ["groot"] + } + }], + listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], + listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTags: ["GET /repos/{owner}/{repo}/tags"], + listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], + merge: ["POST /repos/{owner}/{repo}/merges"], + pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], + removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { + mediaType: { + previews: ["mercy"] + } + }], + requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], + setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], + transfer: ["POST /repos/{owner}/{repo}/transfer"], + update: ["PATCH /repos/{owner}/{repo}"], + updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], + updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], + updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], + updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], + updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], + updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], + updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { + baseUrl: "https://uploads.github.com" + }] + }, + search: { + code: ["GET /search/code"], + commits: ["GET /search/commits", { + mediaType: { + previews: ["cloak"] + } + }], + issuesAndPullRequests: ["GET /search/issues"], + labels: ["GET /search/labels"], + repos: ["GET /search/repositories"], + topics: ["GET /search/topics"], + users: ["GET /search/users"] + }, + teams: { + addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], + addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}", { + mediaType: { + previews: ["inertia"] + } + }], + addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}", { + mediaType: { + previews: ["inertia"] + } + }], + checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + create: ["POST /orgs/{org}/teams"], + createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], + deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], + getByName: ["GET /orgs/{org}/teams/{team_slug}"], + getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], + list: ["GET /orgs/{org}/teams"], + listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], + listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], + listForAuthenticatedUser: ["GET /user/teams"], + listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], + listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects", { + mediaType: { + previews: ["inertia"] + } + }], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], + removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] + }, + users: { + addEmailForAuthenticated: ["POST /user/emails"], + block: ["PUT /user/blocks/{username}"], + checkBlocked: ["GET /user/blocks/{username}"], + checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], + checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], + createGpgKeyForAuthenticated: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: ["POST /user/keys"], + deleteEmailForAuthenticated: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}"], + follow: ["PUT /user/following/{username}"], + getAuthenticated: ["GET /user"], + getByUsername: ["GET /users/{username}"], + getContextForUser: ["GET /users/{username}/hovercard"], + getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}"], + list: ["GET /users"], + listBlockedByAuthenticated: ["GET /user/blocks"], + listEmailsForAuthenticated: ["GET /user/emails"], + listFollowedByAuthenticated: ["GET /user/following"], + listFollowersForAuthenticatedUser: ["GET /user/followers"], + listFollowersForUser: ["GET /users/{username}/followers"], + listFollowingForUser: ["GET /users/{username}/following"], + listGpgKeysForAuthenticated: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: ["GET /user/keys"], + setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility"], + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] + } }; +const VERSION = "4.0.0"; -/***/ }), - -/***/ 881: -/***/ (function(module) { +function endpointsToMethods(octokit, endpointsMap) { + const newMethods = {}; -"use strict"; + for (const [scope, endpoints] of Object.entries(endpointsMap)) { + for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign({ + method, + url + }, defaults); + if (!newMethods[scope]) { + newMethods[scope] = {}; + } -const isWin = process.platform === 'win32'; + const scopeMethods = newMethods[scope]; -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, - }); -} + if (decorations) { + scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); + continue; + } -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; + scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); } + } - 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 - }; + return newMethods; } -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + /* istanbul ignore next */ - return null; -} + function withDecorations(...args) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); + if (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: undefined + }); + return requestWithDefaults(options); } - return null; -} - -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, -}; - - -/***/ }), - -/***/ 883: -/***/ (function(module) { - -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); + } -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); + } -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + if (decorations.renamedParameters) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + const options = requestWithDefaults.endpoint.merge(...args); -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; + for (const [name, alias] of Object.entries(decorations.renamedParameters)) { + if (name in options) { + octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; + if (!(alias in options)) { + options[alias] = options[name]; + } -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; + delete options[name]; + } + } -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + return requestWithDefaults(options); + } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); + return requestWithDefaults(...args); + } -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; + return Object.assign(withDecorations, requestWithDefaults); } /** - * Checks if `value` is a host object in IE < 9. + * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary + * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is + * done, we will remove the registerEndpoints methods and return the methods + * directly as with the other plugins. At that point we will also remove the + * legacy workarounds and deprecations. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + * See the plan at + * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +function restEndpointMethods(octokit) { + return endpointsToMethods(octokit, Endpoints); +} +restEndpointMethods.VERSION = VERSION; -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +exports.restEndpointMethods = restEndpointMethods; +//# sourceMappingURL=index.js.map -/** Built-in value references. */ -var Symbol = root.Symbol, - splice = arrayProto.splice; -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); +/***/ }), -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; +/***/ 862: +/***/ (function(__unusedmodule, exports) { -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +"use strict"; -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} +Object.defineProperty(exports, '__esModule', { value: true }); -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; +function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } -} -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; + return ""; } -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} +exports.getUserAgent = getUserAgent; +//# sourceMappingURL=index.js.map -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - return index < 0 ? undefined : data[index][1]; -} +/***/ }), -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} +/***/ 866: +/***/ (function(module) { -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); +module.exports = removeHook - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; +function removeHook (state, name, method) { + if (!state.registry[name]) { + return } - return this; -} -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; + var index = state.registry[name] + .map(function (registered) { return registered.orig }) + .indexOf(method) -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + if (index === -1) { + return } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); + state.registry[name].splice(index, 1) } -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; +/***/ }), -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} +/***/ 884: +/***/ (function(module, __unusedexports, __webpack_require__) { -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} +"use strict"; -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} -/** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = isKey(path, object) ? [path] : castPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; -} +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__(607); -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value) { - return isArray(value) ? value : stringToPath(value); -} +// `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; -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} + const shebang = parsed.file && readShebang(parsed.file); -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} + return resolveCommand(parsed); + } -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); + return parsed.file; } -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoize(function(string) { - string = toString(string); + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} + // 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); -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} + // 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); -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; + // 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(' '); - if (cache.has(key)) { - return cache.get(key); + 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 } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; + + return parsed; } -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; +function parseShell(parsed) { + // If node supports the shell option, there's no need to mimic its behavior + if (supportsShellOption) { + return parsed; + } -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} + // 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(' '); -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; + 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'; + } -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} + parsed.args = ['-c', shellCommand]; + } -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return parsed; } -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; -/** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ -function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); + // Delegate further parsing to shell or non-shell + return options.shell ? parseShell(parsed) : parseNonShell(parsed); } -module.exports = set; +module.exports = parse; /***/ }), @@ -25033,9 +9244,9 @@ module.exports = set; Object.defineProperty(exports, '__esModule', { value: true }); var request = __webpack_require__(753); -var universalUserAgent = __webpack_require__(796); +var universalUserAgent = __webpack_require__(862); -const VERSION = "4.3.1"; +const VERSION = "4.5.2"; class GraphqlError extends Error { constructor(request, response) { @@ -25054,7 +9265,7 @@ class GraphqlError extends Error { } -const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"]; +const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; function graphql(request, query, options) { options = typeof query === "string" ? options = Object.assign({ query @@ -25117,56 +9328,44 @@ exports.withCustomRequest = withCustomRequest; /***/ }), -/***/ 916: -/***/ (function(__unusedmodule, exports) { +/***/ 907: +/***/ (function(module, __unusedexports, __webpack_require__) { "use strict"; +var shebangRegex = __webpack_require__(473); -Object.defineProperty(exports, '__esModule', { value: true }); - -const VERSION = "1.0.0"; +module.exports = function (str) { + var match = str.match(shebangRegex); -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ + if (!match) { + return null; + } -function requestLog(octokit) { - octokit.hook.wrap("request", (request, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path = requestOptions.url.replace(options.baseUrl, ""); - return request(options).then(response => { - octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); - return response; - }).catch(error => { - octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); - throw error; - }); - }); -} -requestLog.VERSION = VERSION; + var arr = match[0].replace(/#! ?/, '').split(' '); + var bin = arr[0].split('/').pop(); + var arg = arr[1]; -exports.requestLog = requestLog; -//# sourceMappingURL=index.js.map + return (bin === 'env' ? + arg : + bin + (arg ? ' ' + arg : '') + ); +}; /***/ }), -/***/ 929: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = hasNextPage +/***/ 921: +/***/ (function(__unusedmodule, exports, __webpack_require__) { -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) +"use strict"; -function hasNextPage (link) { - deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`) - return getPageLinks(link).next -} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Octokit = void 0; +const core_1 = __webpack_require__(448); +const plugin_paginate_rest_1 = __webpack_require__(299); +const plugin_rest_endpoint_methods_1 = __webpack_require__(842); +exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.restEndpointMethods); /***/ }), @@ -25254,34 +9453,6 @@ function checkBypass(reqUrl) { exports.checkBypass = checkBypass; -/***/ }), - -/***/ 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: @@ -25291,7 +9462,7 @@ 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); @@ -25658,7 +9829,7 @@ module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, "use strict"; -const {PassThrough} = __webpack_require__(413); +const {PassThrough} = __webpack_require__(794); module.exports = options => { options = Object.assign({}, options); diff --git a/jest.config.js b/jest.config.js index ac73c65af..14e44f9f7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,11 @@ -process.env = Object.assign(process.env, { - GITHUB_REPOSITORY: "peter-evans/slash-command-dispatch" -}); +module.exports = { + clearMocks: true, + moduleFileExtensions: ['js', 'ts'], + testEnvironment: 'node', + testMatch: ['**/*.test.ts'], + testRunner: 'jest-circus/runner', + transform: { + '^.+\\.ts$': 'ts-jest' + }, + verbose: true +} diff --git a/package-lock.json b/package-lock.json index 0a1e0c5cd..e706df453 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,14 @@ "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==" }, "@actions/github": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-2.1.1.tgz", - "integrity": "sha512-kAgTGUx7yf5KQCndVeHSwCNZuDBvPyxm5xKTswW2lofugeuC1AZX73nUUVDNaysnM9aKFMHv9YCdVJbg7syEyA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", + "integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", "requires": { - "@actions/http-client": "^1.0.3", - "@octokit/graphql": "^4.3.1", - "@octokit/rest": "^16.43.1" + "@actions/http-client": "^1.0.8", + "@octokit/core": "^3.0.0", + "@octokit/plugin-paginate-rest": "^2.2.3", + "@octokit/plugin-rest-endpoint-methods": "^4.0.0" } }, "@actions/http-client": { @@ -28,57 +29,52 @@ } }, "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", - "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.6", - "@babel/parser": "^7.9.6", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", + "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-module-transforms": "^7.10.5", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", "json5": "^2.1.2", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "minimist": "^1.2.5" } }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true }, "source-map": { "version": "0.5.7", @@ -89,14 +85,13 @@ } }, "@babel/generator": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", - "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", "dev": true, "requires": { - "@babel/types": "^7.9.6", + "@babel/types": "^7.10.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" }, "dependencies": { @@ -109,136 +104,188 @@ } }, "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", + "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.5" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", + "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", - "lodash": "^4.17.13" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", - "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/helpers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", - "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/parser": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", - "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -260,12 +307,21 @@ } }, "@babel/plugin-syntax-class-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz", - "integrity": "sha512-UcAyQWg2bAN647Q+O811tG9MrJ38Z10jjhQdKNAL8fsyPzE3cCN/uT+f55cFVY4aGO4jqJAvmqsuY3GQDwAoXg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", + "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-json-strings": { @@ -278,12 +334,12 @@ } }, "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-Zpg2Sgc++37kuFl6ppq2Q7Awc6E6AIW671x5PY8E/f7MCIyPPGK/EoeZXvvY3P42exZ3Q4/t3YOzP/HiN79jDg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-nullish-coalescing-operator": { @@ -296,12 +352,12 @@ } }, "@babel/plugin-syntax-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", - "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -332,75 +388,33 @@ } }, "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - } + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/traverse": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", - "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.6", - "@babel/types": "^7.9.6", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" }, "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -410,13 +424,13 @@ } }, "@babel/types": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", - "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.5", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } }, @@ -437,17 +451,67 @@ } }, "@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", "find-up": "^4.1.0", + "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -463,98 +527,70 @@ "dev": true }, "@jest/console": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.0.1.tgz", - "integrity": "sha512-9t1KUe/93coV1rBSxMmBAOIK3/HVpwxArCA1CxskKyRiv6o8J70V8C/V3OJminVCTa2M0hQI9AWRd5wxu2dAHw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.1.0.tgz", + "integrity": "sha512-+0lpTHMd/8pJp+Nd4lyip+/Iyf2dZJvcCqrlkeZQoQid+JlThA4M9vxHtheyrQ99jJTMQam+es4BcvZ5W5cC3A==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", - "jest-message-util": "^26.0.1", - "jest-util": "^26.0.1", + "jest-message-util": "^26.1.0", + "jest-util": "^26.1.0", "slash": "^3.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "@jest/core": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.0.1.tgz", - "integrity": "sha512-Xq3eqYnxsG9SjDC+WLeIgf7/8KU6rddBxH+SCt18gEpOhAGYC/Mq+YbtlNcIdwjnnT+wDseXSbU0e5X84Y4jTQ==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.1.0.tgz", + "integrity": "sha512-zyizYmDJOOVke4OO/De//aiv8b07OwZzL2cfsvWF3q9YssfpcKfcnZAwDY8f+A76xXSMMYe8i/f/LPocLlByfw==", "dev": true, "requires": { - "@jest/console": "^26.0.1", - "@jest/reporters": "^26.0.1", - "@jest/test-result": "^26.0.1", - "@jest/transform": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/console": "^26.1.0", + "@jest/reporters": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/transform": "^26.1.0", + "@jest/types": "^26.1.0", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.0.1", - "jest-config": "^26.0.1", - "jest-haste-map": "^26.0.1", - "jest-message-util": "^26.0.1", + "jest-changed-files": "^26.1.0", + "jest-config": "^26.1.0", + "jest-haste-map": "^26.1.0", + "jest-message-util": "^26.1.0", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.0.1", - "jest-resolve-dependencies": "^26.0.1", - "jest-runner": "^26.0.1", - "jest-runtime": "^26.0.1", - "jest-snapshot": "^26.0.1", - "jest-util": "^26.0.1", - "jest-validate": "^26.0.1", - "jest-watcher": "^26.0.1", + "jest-resolve": "^26.1.0", + "jest-resolve-dependencies": "^26.1.0", + "jest-runner": "^26.1.0", + "jest-runtime": "^26.1.0", + "jest-snapshot": "^26.1.0", + "jest-util": "^26.1.0", + "jest-validate": "^26.1.0", + "jest-watcher": "^26.1.0", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", "rimraf": "^3.0.0", @@ -562,47 +598,28 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -611,87 +628,141 @@ "requires": { "glob": "^7.1.3" } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + } + } + }, + "@jest/environment": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.1.0.tgz", + "integrity": "sha512-86+DNcGongbX7ai/KE/S3/NcUVZfrwvFzOOWX/W+OOTvTds7j07LtC+MgGydH5c8Ri3uIrvdmVgd1xFD5zt/xA==", + "dev": true, + "requires": { + "@jest/fake-timers": "^26.1.0", + "@jest/types": "^26.1.0", + "jest-mock": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } } } }, - "@jest/environment": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.0.1.tgz", - "integrity": "sha512-xBDxPe8/nx251u0VJ2dFAFz2H23Y98qdIaNwnMK6dFQr05jc+Ne/2np73lOAx+5mSBO/yuQldRrQOf6hP1h92g==", - "dev": true, - "requires": { - "@jest/fake-timers": "^26.0.1", - "@jest/types": "^26.0.1", - "jest-mock": "^26.0.1" - } - }, "@jest/fake-timers": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.0.1.tgz", - "integrity": "sha512-Oj/kCBnTKhm7CR+OJSjZty6N1bRDr9pgiYQr4wY221azLz5PHi08x/U+9+QpceAYOWheauLP8MhtSVFrqXQfhg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.1.0.tgz", + "integrity": "sha512-Y5F3kBVWxhau3TJ825iuWy++BAuQzK/xEa+wD9vDH3RytW9f2DbMVodfUQC54rZDX3POqdxCgcKdgcOL0rYUpA==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "@sinonjs/fake-timers": "^6.0.1", - "jest-message-util": "^26.0.1", - "jest-mock": "^26.0.1", - "jest-util": "^26.0.1" + "jest-message-util": "^26.1.0", + "jest-mock": "^26.1.0", + "jest-util": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "@jest/globals": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.0.1.tgz", - "integrity": "sha512-iuucxOYB7BRCvT+TYBzUqUNuxFX1hqaR6G6IcGgEqkJ5x4htNKo1r7jk1ji9Zj8ZMiMw0oB5NaA7k5Tx6MVssA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.1.0.tgz", + "integrity": "sha512-MKiHPNaT+ZoG85oMaYUmGHEqu98y3WO2yeIDJrs2sJqHhYOy3Z6F7F/luzFomRQ8SQ1wEkmahFAz2291Iv8EAw==", "dev": true, "requires": { - "@jest/environment": "^26.0.1", - "@jest/types": "^26.0.1", - "expect": "^26.0.1" + "@jest/environment": "^26.1.0", + "@jest/types": "^26.1.0", + "expect": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "@jest/reporters": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.0.1.tgz", - "integrity": "sha512-NWWy9KwRtE1iyG/m7huiFVF9YsYv/e+mbflKRV84WDoJfBqUrNRyDbL/vFxQcYLl8IRqI4P3MgPn386x76Gf2g==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.1.0.tgz", + "integrity": "sha512-SVAysur9FOIojJbF4wLP0TybmqwDkdnFxHSPzHMMIYyBtldCW9gG+Q5xWjpMFyErDiwlRuPyMSJSU64A67Pazg==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.0.1", - "@jest/test-result": "^26.0.1", - "@jest/transform": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/console": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/transform": "^26.1.0", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.2", "graceful-fs": "^4.2.4", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^4.0.3", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.0.1", - "jest-resolve": "^26.0.1", - "jest-util": "^26.0.1", - "jest-worker": "^26.0.0", + "jest-haste-map": "^26.1.0", + "jest-resolve": "^26.1.0", + "jest-util": "^26.1.0", + "jest-worker": "^26.1.0", "node-notifier": "^7.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", @@ -700,62 +771,34 @@ "v8-to-istanbul": "^4.1.3" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "@jest/source-map": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.0.0.tgz", - "integrity": "sha512-S2Z+Aj/7KOSU2TfW0dyzBze7xr95bkm5YXNUqqCek+HE0VbNNSNzrRwfIi5lf7wvzDTSS0/ib8XQ1krFNyYgbQ==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.1.0.tgz", + "integrity": "sha512-XYRPYx4eEVX15cMT9mstnO7hkHP3krNtKfxUYd8L7gbtia8JvZZ6bMzSwa6IQJENbudTwKMw5R1BePRD+bkEmA==", "dev": true, "requires": { "callsites": "^3.0.0", @@ -764,46 +807,70 @@ } }, "@jest/test-result": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.0.1.tgz", - "integrity": "sha512-oKwHvOI73ICSYRPe8WwyYPTtiuOAkLSbY8/MfWF3qDEd/sa8EDyZzin3BaXTqufir/O/Gzea4E8Zl14XU4Mlyg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.1.0.tgz", + "integrity": "sha512-Xz44mhXph93EYMA8aYDz+75mFbarTV/d/x0yMdI3tfSRs/vh4CqSxgzVmCps1fPkHDCtn0tU8IH9iCKgGeGpfw==", "dev": true, "requires": { - "@jest/console": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/console": "^26.1.0", + "@jest/types": "^26.1.0", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "@jest/test-sequencer": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.0.1.tgz", - "integrity": "sha512-ssga8XlwfP8YjbDcmVhwNlrmblddMfgUeAkWIXts1V22equp2GMIHxm7cyeD5Q/B0ZgKPK/tngt45sH99yLLGg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.1.0.tgz", + "integrity": "sha512-Z/hcK+rTq56E6sBwMoQhSRDVjqrGtj1y14e2bIgcowARaIE1SgOanwx6gvY4Q9gTKMoZQXbXvptji+q5GYxa6Q==", "dev": true, "requires": { - "@jest/test-result": "^26.0.1", + "@jest/test-result": "^26.1.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.0.1", - "jest-runner": "^26.0.1", - "jest-runtime": "^26.0.1" + "jest-haste-map": "^26.1.0", + "jest-runner": "^26.1.0", + "jest-runtime": "^26.1.0" } }, "@jest/transform": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.0.1.tgz", - "integrity": "sha512-pPRkVkAQ91drKGbzCfDOoHN838+FSbYaEAvBXvKuWeeRRUD8FjwXkqfUNUZL6Ke48aA/1cqq/Ni7kVMCoqagWA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.1.0.tgz", + "integrity": "sha512-ICPm6sUXmZJieq45ix28k0s+d/z2E8CHDsq+WwtWI6kW8m7I8kPqarSEcUN86entHQ570ZBRci5OWaKL0wlAWw==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "babel-plugin-istanbul": "^6.0.0", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.0.1", + "jest-haste-map": "^26.1.0", "jest-regex-util": "^26.0.0", - "jest-util": "^26.0.1", + "jest-util": "^26.1.0", "micromatch": "^4.0.2", "pirates": "^4.0.1", "slash": "^3.0.0", @@ -811,264 +878,158 @@ "write-file-atomic": "^3.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "@jest/types": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.0.1.tgz", - "integrity": "sha512-IbtjvqI9+eS1qFnOIEL7ggWmT+iK/U+Vde9cGWtYb/b6XgKb3X44ZAe/z9YZzoAAZ/E92m0DqrilF934IGNnQA==", + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", + "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^1.1.1", "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "chalk": "^3.0.0" } }, "@octokit/auth-token": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", - "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", + "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", + "requires": { + "@octokit/types": "^5.0.0" + } + }, + "@octokit/core": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.1.0.tgz", + "integrity": "sha512-yPyQSmxIXLieEIRikk2w8AEtWkFdfG/LXcw1KvEtK3iP0ENZLW/WYQmdzOKqfSaLhooz4CJ9D+WY79C8ZliACw==", "requires": { - "@octokit/types": "^2.0.0" + "@octokit/auth-token": "^2.4.0", + "@octokit/graphql": "^4.3.1", + "@octokit/request": "^5.4.0", + "@octokit/types": "^5.0.0", + "before-after-hook": "^2.1.0", + "universal-user-agent": "^5.0.0" } }, "@octokit/endpoint": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", - "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.4.tgz", + "integrity": "sha512-ZJHIsvsClEE+6LaZXskDvWIqD3Ao7+2gc66pRG5Ov4MQtMvCU9wGu1TItw9aGNmRuU9x3Fei1yb+uqGaQnm0nw==", "requires": { - "@octokit/types": "^2.11.1", + "@octokit/types": "^5.0.0", "is-plain-object": "^3.0.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" }, "dependencies": { "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" } } }, "@octokit/graphql": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz", - "integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.2.tgz", + "integrity": "sha512-SpB/JGdB7bxRj8qowwfAXjMpICUYSJqRDj26MKJAryRQBqp/ZzARsaO2LEFWzDaps0FLQoPYVGppS0HQXkBhdg==", "requires": { "@octokit/request": "^5.3.0", - "@octokit/types": "^2.0.0", - "universal-user-agent": "^4.0.0" + "@octokit/types": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + } } }, "@octokit/plugin-paginate-rest": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", - "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.2.3.tgz", + "integrity": "sha512-eKTs91wXnJH8Yicwa30jz6DF50kAh7vkcqCQ9D7/tvBAP5KKkg6I2nNof8Mp/65G0Arjsb4QcOJcIEQY+rK1Rg==", "requires": { - "@octokit/types": "^2.0.1" + "@octokit/types": "^5.0.0" } }, - "@octokit/plugin-request-log": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz", - "integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==" - }, "@octokit/plugin-rest-endpoint-methods": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", - "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.0.0.tgz", + "integrity": "sha512-emS6gysz4E9BNi9IrCl7Pm4kR+Az3MmVB0/DoDCmF4U48NbYG3weKyDlgkrz6Jbl4Mu4nDx8YWZwC4HjoTdcCA==", "requires": { - "@octokit/types": "^2.0.1", + "@octokit/types": "^5.0.0", "deprecation": "^2.3.1" } }, "@octokit/request": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", - "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.6.tgz", + "integrity": "sha512-9r8Sn4CvqFI9LDLHl9P17EZHwj3ehwQnTpTE+LEneb0VBBqSiI/VS4rWIBfBhDrDs/aIGEGZRSB0QWAck8u+2g==", "requires": { "@octokit/endpoint": "^6.0.1", "@octokit/request-error": "^2.0.0", - "@octokit/types": "^2.11.1", + "@octokit/types": "^5.0.0", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", "once": "^1.4.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" }, "dependencies": { "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" } } }, "@octokit/request-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", - "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", + "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", "requires": { - "@octokit/types": "^2.0.0", + "@octokit/types": "^5.0.1", "deprecation": "^2.0.0", "once": "^1.4.0" } }, - "@octokit/rest": { - "version": "16.43.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz", - "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==", - "requires": { - "@octokit/auth-token": "^2.4.0", - "@octokit/plugin-paginate-rest": "^1.1.1", - "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "2.4.0", - "@octokit/request": "^5.2.0", - "@octokit/request-error": "^1.0.2", - "atob-lite": "^2.0.0", - "before-after-hook": "^2.0.0", - "btoa-lite": "^1.0.0", - "deprecation": "^2.0.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "@octokit/request-error": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", - "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", - "requires": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - } - } - }, "@octokit/types": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.12.2.tgz", - "integrity": "sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.1.0.tgz", + "integrity": "sha512-OFxUBgrEllAbdEmWp/wNmKIu5EuumKHG4sgy56vjZ8lXPgMhF05c76hmulfOdFHHYRpPj49ygOZJ8wgVsPecuA==", "requires": { "@types/node": ">= 8" } }, "@sinonjs/commons": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz", - "integrity": "sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", + "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", "dev": true, "requires": { "type-detect": "4.0.8" @@ -1084,9 +1045,9 @@ } }, "@types/babel__core": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.7.tgz", - "integrity": "sha512-RL62NqSFPCDK2FM1pSDH0scHpJvsXtZNiYlMB73DgPBaG1E38ZYVL+ei5EkWRbr+KC4YNiAUNBnRj+bgwpgjMw==", + "version": "7.1.9", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.9.tgz", + "integrity": "sha512-sY2RsIJ5rpER1u3/aQ8OFSI7qGIy8o1NEEbgb2UaJcvOtXOMpd39ko723NBpjQFg9SIX7TXtjejZVGeIMLhoOw==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -1116,9 +1077,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.11.tgz", - "integrity": "sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.13.tgz", + "integrity": "sha512-i+zS7t6/s9cdQvbqKDARrcbrPvtJGlbYsMkazo03nTAK3RX9FNrLllXys22uiTGJapPOTZTQ35nHh4ISph4SLQ==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -1130,6 +1091,12 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/graceful-fs": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.3.tgz", @@ -1140,9 +1107,9 @@ } }, "@types/istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", "dev": true }, "@types/istanbul-lib-report": { @@ -1155,19 +1122,41 @@ } }, "@types/istanbul-reports": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", - "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", + "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "*", "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "26.0.4", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.4.tgz", + "integrity": "sha512-4fQNItvelbNA9+sFgU+fhJo8ZFF+AS4Egk3GWwCW2jFtViukXbnztccafAdLhzE/0EiCogljtQQXP8aQ9J7sFg==", + "dev": true, + "requires": { + "jest-diff": "^25.2.1", + "pretty-format": "^25.2.1" + } + }, + "@types/json-schema": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/node": { - "version": "13.13.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", - "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==" + "version": "14.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", + "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -1176,9 +1165,9 @@ "dev": true }, "@types/prettier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.0.tgz", - "integrity": "sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.2.tgz", + "integrity": "sha512-IkVfat549ggtkZUthUzEX49562eGikhSYeVGX97SkMFn+sTZrgRewXjQ4tPKFPCykZHkX1Zfd9OoELGqKU2jJA==", "dev": true }, "@types/stack-utils": { @@ -1188,9 +1177,9 @@ "dev": true }, "@types/yargs": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz", - "integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==", + "version": "15.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz", + "integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -1202,10 +1191,81 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.1.tgz", + "integrity": "sha512-06lfjo76naNeOMDl+mWG9Fh/a0UHKLGhin+mGaIw72FUMbMGBkdi/FEJmgEDzh4eE73KIYzHWvOCYJ0ak7nrJQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "3.6.1", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz", + "integrity": "sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.6.1.tgz", + "integrity": "sha512-SLihQU8RMe77YJ/jGTqOt0lMq7k3hlPVfp7v/cxMnXA9T0bQYoMDfTsNgHXpwSJM1Iq2aAJ8WqekxUwGv5F67Q==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.6.1", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/types": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.1.tgz", + "integrity": "sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz", + "integrity": "sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/visitor-keys": "3.6.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz", + "integrity": "sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "@zeit/ncc": { - "version": "0.22.1", - "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.1.tgz", - "integrity": "sha512-Qq3bMuonkcnV/96jhy9SQYdh39NXHxNMJ1O31ZFzWG9n52fR2DLtgrNzhj/ahlEjnBziMLGVWDbaS9sf03/fEw==", + "version": "0.22.3", + "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz", + "integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==", "dev": true }, "abab": { @@ -1215,9 +1275,9 @@ "dev": true }, "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", "dev": true }, "acorn-globals": { @@ -1231,36 +1291,50 @@ } }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "acorn-walk": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", - "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "version": "6.12.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", + "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-escapes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", - "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } } }, "ansi-regex": { @@ -1270,12 +1344,13 @@ "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "anymatch": { @@ -1315,12 +1390,33 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -1360,11 +1456,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "atob-lite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", - "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=" - }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -1372,76 +1463,48 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "dev": true }, "babel-jest": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.0.1.tgz", - "integrity": "sha512-Z4GGmSNQ8pX3WS1O+6v3fo41YItJJZsVxG5gIQ+HuB/iuAQBJxMTHTwz292vuYws1LnHfwSRgoqI+nxdy/pcvw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.1.0.tgz", + "integrity": "sha512-Nkqgtfe7j6PxLO6TnCQQlkMm8wdTdnIF8xrdpooHCuD5hXRzVEPbPneTJKknH5Dsv3L8ip9unHDAp48YQ54Dkg==", "dev": true, "requires": { - "@jest/transform": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/transform": "^26.1.0", + "@jest/types": "^26.1.0", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.0.0", + "babel-preset-jest": "^26.1.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "slash": "^3.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, @@ -1459,25 +1522,27 @@ } }, "babel-plugin-jest-hoist": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.0.0.tgz", - "integrity": "sha512-+AuoehOrjt9irZL7DOt2+4ZaTM6dlu1s5TTS46JBa0/qem4dy7VNW3tMb96qeEqcIh20LD73TVNtmVEeymTG7w==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.1.0.tgz", + "integrity": "sha512-qhqLVkkSlqmC83bdMhM8WW4Z9tB+JkjqAqlbbohS9sJLT5Ha2vfzuKqg5yenXrAjOPG2YC0WiXdH3a9PvB+YYw==", "dev": true, "requires": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", "@types/babel__traverse": "^7.0.6" } }, "babel-preset-current-node-syntax": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.2.tgz", - "integrity": "sha512-u/8cS+dEiK1SFILbOC8/rUI3ml9lboKuuMvZ/4aQnQmhecQAgPw5ew066C1ObnEAUmlx7dv/s2z52psWEtLNiw==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.3.tgz", + "integrity": "sha512-uyexu1sVwcdFnyq9o8UQYsXwXflIh8LvrF5+cKrYam93ned1CStffB3+BEcsxGSgagoA3GEyjDqO4a/58hyPYQ==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", @@ -1488,12 +1553,12 @@ } }, "babel-preset-jest": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.0.0.tgz", - "integrity": "sha512-9ce+DatAa31DpR4Uir8g4Ahxs5K4W4L8refzt+qHWQANb6LhGcAEfIFgLUwk67oya2cCUd6t4eUMtO/z64ocNw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.1.0.tgz", + "integrity": "sha512-na9qCqFksknlEj5iSdw1ehMVR06LCCTkZLGKeEtxDDdhg8xpUF09m29Kvh1pRbZ07h7AQ5ttLYUwpXL4tO6w7w==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.0.0", + "babel-plugin-jest-hoist": "^26.1.0", "babel-preset-current-node-syntax": "^0.1.2" } }, @@ -1555,12 +1620,6 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, @@ -1603,6 +1662,15 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, "bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -1612,11 +1680,6 @@ "node-int64": "^0.4.0" } }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -1638,14 +1701,6 @@ "to-object-path": "^0.3.0", "union-value": "^1.0.0", "unset-value": "^1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } } }, "callsites": { @@ -1676,14 +1731,13 @@ "dev": true }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "char-regex": { @@ -1692,12 +1746,6 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -1724,30 +1772,9 @@ "requires": { "is-descriptor": "^0.1.0" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -1759,13 +1786,27 @@ "wrap-ansi": "^6.2.0" }, "dependencies": { - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } } } @@ -1793,18 +1834,18 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "combined-stream": { @@ -1828,6 +1869,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "convert-source-map": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", @@ -1850,15 +1897,14 @@ "dev": true }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "cssom": { @@ -1931,6 +1977,12 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1943,6 +1995,15 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -1981,12 +2042,6 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, @@ -2008,9 +2063,9 @@ "dev": true }, "diff-sequences": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.0.0.tgz", - "integrity": "sha512-JC/eHYEC3aSS0vZGjuoc4vHA0yAQTzhQQldXMeMF+JlxLGJlCO38Gma82NV9gk1jGFz8mDzUMeaKXvjRRdJ2dg==", + "version": "25.2.6", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", + "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", "dev": true }, "doctrine": { @@ -2050,9 +2105,9 @@ } }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "end-of-stream": { @@ -2063,6 +2118,15 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2072,6 +2136,36 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2079,9 +2173,9 @@ "dev": true }, "escodegen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", - "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -2089,25 +2183,67 @@ "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" + }, + "dependencies": { + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } } }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.4.0.tgz", + "integrity": "sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", @@ -2116,38 +2252,239 @@ "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", + "levn": "^0.4.1", "lodash": "^4.17.14", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-eslint-comments": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", + "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "ignore": "^5.0.5" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + } + } + }, + "eslint-plugin-github": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.0.1.tgz", + "integrity": "sha512-DkiME1DhBSd4ZarVKiF2qnlSg934UMiMFpo0FKHahSxeiCiAR1pd8Xfv/a64TDxs/mfLwuBZZXf/BM5UsWNyEg==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": ">=2.25.0", + "@typescript-eslint/parser": ">=2.25.0", + "eslint-config-prettier": ">=6.10.1", + "eslint-plugin-eslint-comments": ">=3.0.1", + "eslint-plugin-import": ">=2.20.1", + "eslint-plugin-prettier": ">=3.1.2", + "eslint-rule-documentation": ">=1.0.0", + "prettier": ">=1.12.0", + "svg-element-attributes": ">=1.3.1" + } + }, + "eslint-plugin-import": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", + "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, + "eslint-plugin-jest": { + "version": "23.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.18.0.tgz", + "integrity": "sha512-wLPM/Rm1SGhxrFQ2TKM/BYsYPhn7ch6ZEK92S2o/vGkAAnDXM0I4nTIo745RIX+VlCRMFgBuJEax6XfTHMdeKg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^2.5.0" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", + "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.34.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", + "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + } + } + }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-rule-documentation": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/eslint-rule-documentation/-/eslint-rule-documentation-1.0.23.tgz", + "integrity": "sha512-pWReu3fkohwyvztx/oQWWgld2iad25TfUdi6wvhhaDPIQjHU/pyvlKgXFw1kX31SQK2Nq9MH+vRDWB0ZLy8fYw==", + "dev": true + }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2155,29 +2492,29 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "espree": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", - "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", "dev": true, "requires": { - "acorn": "^7.1.0", - "acorn-jsx": "^5.1.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.3.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" } }, "esprima": { @@ -2187,12 +2524,20 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } } }, "esrecurse": { @@ -2234,6 +2579,51 @@ "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + } } }, "exit": { @@ -2293,42 +2683,45 @@ } }, "expect": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.0.1.tgz", - "integrity": "sha512-QcCy4nygHeqmbw564YxNbHTJlXh47dVID2BUP52cZFpLU9zHViMFK6h07cC1wf7GYCTIigTdAXhVua8Yl1FkKg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.1.0.tgz", + "integrity": "sha512-QbH4LZXDsno9AACrN9eM0zfnby9G+OsdNgZUohjg/P0mLy1O+/bzTAJGT6VSIjVCe8yKM6SzEl/ckEOFBT7Vnw==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "ansi-styles": "^4.0.0", "jest-get-type": "^26.0.0", - "jest-matcher-utils": "^26.0.1", - "jest-message-util": "^26.0.1", + "jest-matcher-utils": "^26.1.0", + "jest-message-util": "^26.1.0", "jest-regex-util": "^26.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "color-name": "~1.1.4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true } } @@ -2366,26 +2759,9 @@ "requires": { "isobject": "^3.0.1" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -2458,15 +2834,21 @@ "dev": true }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -2484,15 +2866,6 @@ "bser": "2.1.1" } }, - "figures": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", - "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", @@ -2512,13 +2885,12 @@ } }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { @@ -2533,9 +2905,9 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "for-in": { @@ -2583,6 +2955,12 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -2601,6 +2979,18 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -2639,18 +3029,18 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", - "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { "type-fest": "^0.8.1" @@ -2685,10 +3075,25 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "has-value": { @@ -2700,14 +3105,6 @@ "get-value": "^2.0.6", "has-values": "^1.0.0", "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } } }, "has-values": { @@ -2822,6 +3219,66 @@ "requires": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } } }, "imurmurhash": { @@ -2846,27 +3303,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "inquirer": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz", - "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^2.4.2", - "cli-cursor": "^3.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.15", - "mute-stream": "0.0.8", - "run-async": "^2.2.0", - "rxjs": "^6.5.3", - "string-width": "^4.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - } - }, "ip-regex": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", @@ -2905,6 +3341,12 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "dev": true + }, "is-ci": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", @@ -2934,6 +3376,12 @@ } } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -2973,9 +3421,9 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-generator-fn": { @@ -3000,12 +3448,9 @@ "dev": true }, "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "requires": { - "isobject": "^4.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==" }, "is-potential-custom-element-name": { "version": "1.0.0", @@ -3013,17 +3458,35 @@ "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", "dev": true }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-stream": { + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3058,9 +3521,10 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -3075,15 +3539,12 @@ "dev": true }, "istanbul-lib-instrument": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", - "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" @@ -3106,23 +3567,6 @@ "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "istanbul-lib-source-maps": { @@ -3147,115 +3591,98 @@ } }, "jest": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.0.1.tgz", - "integrity": "sha512-29Q54kn5Bm7ZGKIuH2JRmnKl85YRigp0o0asTc6Sb6l2ch1DCXIeZTLLFy9ultJvhkTqbswF5DEx4+RlkmCxWg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.1.0.tgz", + "integrity": "sha512-LIti8jppw5BcQvmNJe4w2g1N/3V68HUfAv9zDVm7v+VAtQulGhH0LnmmiVkbNE4M4I43Bj2fXPiBGKt26k9tHw==", "dev": true, "requires": { - "@jest/core": "^26.0.1", + "@jest/core": "^26.1.0", "import-local": "^3.0.2", - "jest-cli": "^26.0.1" + "jest-cli": "^26.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "jest-cli": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.0.1.tgz", - "integrity": "sha512-pFLfSOBcbG9iOZWaMK4Een+tTxi/Wcm34geqZEqrst9cZDkTQ1LZ2CnBrTlHWuYAiTMFr0EQeK52ScyFU8wK+w==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.1.0.tgz", + "integrity": "sha512-Imumvjgi3rU7stq6SJ1JUEMaV5aAgJYXIs0jPqdUnF47N/Tk83EXfmtvNKQ+SnFVI6t6mDOvfM3aA9Sg6kQPSw==", "dev": true, "requires": { - "@jest/core": "^26.0.1", - "@jest/test-result": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/core": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.0.1", - "jest-util": "^26.0.1", - "jest-validate": "^26.0.1", + "jest-config": "^26.1.0", + "jest-util": "^26.1.0", + "jest-validate": "^26.1.0", "prompts": "^2.0.1", "yargs": "^15.3.1" } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "jest-changed-files": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.0.1.tgz", - "integrity": "sha512-q8LP9Sint17HaE2LjxQXL+oYWW/WeeXMPE2+Op9X3mY8IEGFVc14xRxFjUuXUbcPAlDLhtWdIEt59GdQbn76Hw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.1.0.tgz", + "integrity": "sha512-HS5MIJp3B8t0NRKGMCZkcDUZo36mVRvrDETl81aqljT1S9tqiHRSpyoOvWg9ZilzZG9TDisDNaN1IXm54fLRZw==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "execa": "^4.0.0", "throat": "^5.0.0" }, "dependencies": { - "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "execa": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.0.tgz", - "integrity": "sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", + "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -3292,181 +3719,151 @@ "requires": { "path-key": "^3.0.0" } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } } } }, - "jest-config": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.0.1.tgz", - "integrity": "sha512-9mWKx2L1LFgOXlDsC4YSeavnblN6A4CPfXFiobq+YYLaBMymA/SczN7xYTSmLaEYHZOcB98UdoN4m5uNt6tztg==", + "jest-circus": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-26.1.0.tgz", + "integrity": "sha512-V5h5XJLPf0XXwP92GIOx8n0Q6vdPDcFPBuEVQ9/OPzpsx3gquL8fdxaJGZ5TsvkU3zWM7mDWULAKYJMRkA2e+g==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.0.1", - "@jest/types": "^26.0.1", - "babel-jest": "^26.0.1", + "@babel/traverse": "^7.1.0", + "@jest/environment": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.0.1", - "jest-environment-node": "^26.0.1", - "jest-get-type": "^26.0.0", - "jest-jasmine2": "^26.0.1", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.0.1", - "jest-util": "^26.0.1", - "jest-validate": "^26.0.1", - "micromatch": "^4.0.2", - "pretty-format": "^26.0.1" + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^26.1.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^26.1.0", + "jest-matcher-utils": "^26.1.0", + "jest-message-util": "^26.1.0", + "jest-runtime": "^26.1.0", + "jest-snapshot": "^26.1.0", + "jest-util": "^26.1.0", + "pretty-format": "^26.1.0", + "stack-utils": "^2.0.2", + "throat": "^5.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, - "jest-diff": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.0.1.tgz", - "integrity": "sha512-odTcHyl5X+U+QsczJmOjWw5tPvww+y9Yim5xzqxVl/R1j4z71+fHW4g8qu1ugMmKdFdxw+AtQgs5mupPnzcIBQ==", + "jest-config": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.1.0.tgz", + "integrity": "sha512-ONTGeoMbAwGCdq4WuKkMcdMoyfs5CLzHEkzFOlVvcDXufZSaIWh/OXMLa2fwKXiOaFcqEw8qFr4VOKJQfn4CVw==", "dev": true, "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^26.1.0", + "@jest/types": "^26.1.0", + "babel-jest": "^26.1.0", "chalk": "^4.0.0", - "diff-sequences": "^26.0.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^26.1.0", + "jest-environment-node": "^26.1.0", "jest-get-type": "^26.0.0", - "pretty-format": "^26.0.1" + "jest-jasmine2": "^26.1.0", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.1.0", + "jest-util": "^26.1.0", + "jest-validate": "^26.1.0", + "micromatch": "^4.0.2", + "pretty-format": "^26.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, + "jest-diff": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", + "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "diff-sequences": "^25.2.6", + "jest-get-type": "^25.2.6", + "pretty-format": "^25.5.0" + } + }, "jest-docblock": { "version": "26.0.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", @@ -3477,294 +3874,379 @@ } }, "jest-each": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.0.1.tgz", - "integrity": "sha512-OTgJlwXCAR8NIWaXFL5DBbeS4QIYPuNASkzSwMCJO+ywo9BEa6TqkaSWsfR7VdbMLdgYJqSfQcIyjJCNwl5n4Q==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.1.0.tgz", + "integrity": "sha512-lYiSo4Igr81q6QRsVQq9LIkJW0hZcKxkIkHzNeTMPENYYDw/W/Raq28iJ0sLlNFYz2qxxeLnc5K2gQoFYlu2bA==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "jest-get-type": "^26.0.0", - "jest-util": "^26.0.1", - "pretty-format": "^26.0.1" + "jest-util": "^26.1.0", + "pretty-format": "^26.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, "jest-environment-jsdom": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.0.1.tgz", - "integrity": "sha512-u88NJa3aptz2Xix2pFhihRBAatwZHWwSiRLBDBQE1cdJvDjPvv7ZGA0NQBxWwDDn7D0g1uHqxM8aGgfA9Bx49g==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.1.0.tgz", + "integrity": "sha512-dWfiJ+spunVAwzXbdVqPH1LbuJW/kDL+FyqgA5YzquisHqTi0g9hquKif9xKm7c1bKBj6wbmJuDkeMCnxZEpUw==", "dev": true, "requires": { - "@jest/environment": "^26.0.1", - "@jest/fake-timers": "^26.0.1", - "@jest/types": "^26.0.1", - "jest-mock": "^26.0.1", - "jest-util": "^26.0.1", + "@jest/environment": "^26.1.0", + "@jest/fake-timers": "^26.1.0", + "@jest/types": "^26.1.0", + "jest-mock": "^26.1.0", + "jest-util": "^26.1.0", "jsdom": "^16.2.2" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "jest-environment-node": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.0.1.tgz", - "integrity": "sha512-4FRBWcSn5yVo0KtNav7+5NH5Z/tEgDLp7VRQVS5tCouWORxj+nI+1tOLutM07Zb2Qi7ja+HEDoOUkjBSWZg/IQ==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.1.0.tgz", + "integrity": "sha512-DNm5x1aQH0iRAe9UYAkZenuzuJ69VKzDCAYISFHQ5i9e+2Tbeu2ONGY7YStubCLH8a1wdKBgqScYw85+ySxqxg==", "dev": true, "requires": { - "@jest/environment": "^26.0.1", - "@jest/fake-timers": "^26.0.1", - "@jest/types": "^26.0.1", - "jest-mock": "^26.0.1", - "jest-util": "^26.0.1" + "@jest/environment": "^26.1.0", + "@jest/fake-timers": "^26.1.0", + "@jest/types": "^26.1.0", + "jest-mock": "^26.1.0", + "jest-util": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "jest-get-type": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", - "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", + "version": "25.2.6", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", + "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", "dev": true }, "jest-haste-map": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.0.1.tgz", - "integrity": "sha512-J9kBl/EdjmDsvyv7CiyKY5+DsTvVOScenprz/fGqfLg/pm1gdjbwwQ98nW0t+OIt+f+5nAVaElvn/6wP5KO7KA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.1.0.tgz", + "integrity": "sha512-WeBS54xCIz9twzkEdm6+vJBXgRBQfdbbXD0dk8lJh7gLihopABlJmIQFdWSDDtuDe4PRiObsjZSUjbJ1uhWEpA==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", - "jest-serializer": "^26.0.0", - "jest-util": "^26.0.1", - "jest-worker": "^26.0.0", + "jest-serializer": "^26.1.0", + "jest-util": "^26.1.0", + "jest-worker": "^26.1.0", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7", "which": "^2.0.2" }, "dependencies": { - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "isexe": "^2.0.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } } } }, "jest-jasmine2": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.0.1.tgz", - "integrity": "sha512-ILaRyiWxiXOJ+RWTKupzQWwnPaeXPIoLS5uW41h18varJzd9/7I0QJGqg69fhTT1ev9JpSSo9QtalriUN0oqOg==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.1.0.tgz", + "integrity": "sha512-1IPtoDKOAG+MeBrKvvuxxGPJb35MTTRSDglNdWWCndCB3TIVzbLThRBkwH9P081vXLgiJHZY8Bz3yzFS803xqQ==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.0.1", - "@jest/source-map": "^26.0.0", - "@jest/test-result": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/environment": "^26.1.0", + "@jest/source-map": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.0.1", + "expect": "^26.1.0", "is-generator-fn": "^2.0.0", - "jest-each": "^26.0.1", - "jest-matcher-utils": "^26.0.1", - "jest-message-util": "^26.0.1", - "jest-runtime": "^26.0.1", - "jest-snapshot": "^26.0.1", - "jest-util": "^26.0.1", - "pretty-format": "^26.0.1", + "jest-each": "^26.1.0", + "jest-matcher-utils": "^26.1.0", + "jest-message-util": "^26.1.0", + "jest-runtime": "^26.1.0", + "jest-snapshot": "^26.1.0", + "jest-util": "^26.1.0", + "pretty-format": "^26.1.0", "throat": "^5.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", + "dev": true, + "requires": { + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" + } + } + } + }, + "jest-leak-detector": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.1.0.tgz", + "integrity": "sha512-dsMnKF+4BVOZwvQDlgn3MG+Ns4JuLv8jNvXH56bgqrrboyCbI1rQg6EI5rs+8IYagVcfVP2yZFKfWNZy0rK0Hw==", + "dev": true, + "requires": { + "jest-get-type": "^26.0.0", + "pretty-format": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "color-name": "~1.1.4" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, - "jest-leak-detector": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.0.1.tgz", - "integrity": "sha512-93FR8tJhaYIWrWsbmVN1pQ9ZNlbgRpfvrnw5LmgLRX0ckOJ8ut/I35CL7awi2ecq6Ca4lL59bEK9hr7nqoHWPA==", - "dev": true, - "requires": { - "jest-get-type": "^26.0.0", - "pretty-format": "^26.0.1" - } - }, "jest-matcher-utils": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.0.1.tgz", - "integrity": "sha512-PUMlsLth0Azen8Q2WFTwnSkGh2JZ8FYuwijC8NR47vXKpsrKmA1wWvgcj1CquuVfcYiDEdj985u5Wmg7COEARw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.1.0.tgz", + "integrity": "sha512-PW9JtItbYvES/xLn5mYxjMd+Rk+/kIt88EfH3N7w9KeOrHWaHrdYPnVHndGbsFGRJ2d5gKtwggCvkqbFDoouQA==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.0.1", + "jest-diff": "^26.1.0", "jest-get-type": "^26.0.0", - "pretty-format": "^26.0.1" + "pretty-format": "^26.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "diff-sequences": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.0.0.tgz", + "integrity": "sha512-JC/eHYEC3aSS0vZGjuoc4vHA0yAQTzhQQldXMeMF+JlxLGJlCO38Gma82NV9gk1jGFz8mDzUMeaKXvjRRdJ2dg==", + "dev": true + }, + "jest-diff": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.1.0.tgz", + "integrity": "sha512-GZpIcom339y0OXznsEKjtkfKxNdg7bVbEofK8Q6MnevTIiR1jNhDWKhRX6X0SDXJlwn3dy59nZ1z55fLkAqPWg==", "dev": true, "requires": { - "color-name": "~1.1.4" + "chalk": "^4.0.0", + "diff-sequences": "^26.0.0", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.1.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, "jest-message-util": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.0.1.tgz", - "integrity": "sha512-CbK8uQREZ8umUfo8+zgIfEt+W7HAHjQCoRaNs4WxKGhAYBGwEyvxuK81FXa7VeB9pwDEXeeKOB2qcsNVCAvB7Q==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.1.0.tgz", + "integrity": "sha512-dY0+UlldiAJwNDJ08SF0HdF32g9PkbF2NRK/+2iMPU40O6q+iSn1lgog/u0UH8ksWoPv0+gNq8cjhYO2MFtT0g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "@types/stack-utils": "^1.0.1", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -3773,71 +4255,67 @@ "stack-utils": "^2.0.2" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + } + } + }, + "jest-mock": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.1.0.tgz", + "integrity": "sha512-1Rm8EIJ3ZFA8yCIie92UbxZWj9SuVmUGcyhLHyAhY6WI3NIct38nVcfOPWhJteqSn8V8e3xOMha9Ojfazfpovw==", + "dev": true, + "requires": { + "@jest/types": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "color-name": "~1.1.4" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } } } }, - "jest-mock": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.0.1.tgz", - "integrity": "sha512-MpYTBqycuPYSY6xKJognV7Ja46/TeRbAZept987Zp+tuJvMN0YBWyyhG9mXyYQaU3SBI0TUlSaO5L3p49agw7Q==", - "dev": true, - "requires": { - "@jest/types": "^26.0.1" - } - }, "jest-pnp-resolver": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", "dev": true }, "jest-regex-util": { @@ -3847,426 +4325,440 @@ "dev": true }, "jest-resolve": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.0.1.tgz", - "integrity": "sha512-6jWxk0IKZkPIVTvq6s72RH735P8f9eCJW3IM5CX/SJFeKq1p2cZx0U49wf/SdMlhaB/anann5J2nCJj6HrbezQ==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.1.0.tgz", + "integrity": "sha512-KsY1JV9FeVgEmwIISbZZN83RNGJ1CC+XUCikf/ZWJBX/tO4a4NvA21YixokhdR9UnmPKKAC4LafVixJBrwlmfg==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.1", - "jest-util": "^26.0.1", + "jest-util": "^26.1.0", "read-pkg-up": "^7.0.1", "resolve": "^1.17.0", "slash": "^3.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "p-locate": "^4.1.0" } }, - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "p-try": "^2.0.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "color-name": "~1.1.4" + "p-limit": "^2.2.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "has-flag": { + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" } } } }, "jest-resolve-dependencies": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.0.1.tgz", - "integrity": "sha512-9d5/RS/ft0vB/qy7jct/qAhzJsr6fRQJyGAFigK3XD4hf9kIbEH5gks4t4Z7kyMRhowU6HWm/o8ILqhaHdSqLw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.1.0.tgz", + "integrity": "sha512-fQVEPHHQ1JjHRDxzlLU/buuQ9om+hqW6Vo928aa4b4yvq4ZHBtRSDsLdKQLuCqn5CkTVpYZ7ARh2fbA8WkRE6g==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.0.1" + "jest-snapshot": "^26.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "jest-runner": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.0.1.tgz", - "integrity": "sha512-CApm0g81b49Znm4cZekYQK67zY7kkB4umOlI2Dx5CwKAzdgw75EN+ozBHRvxBzwo1ZLYZ07TFxkaPm+1t4d8jA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.1.0.tgz", + "integrity": "sha512-elvP7y0fVDREnfqit0zAxiXkDRSw6dgCkzPCf1XvIMnSDZ8yogmSKJf192dpOgnUVykmQXwYYJnCx641uLTgcw==", "dev": true, "requires": { - "@jest/console": "^26.0.1", - "@jest/environment": "^26.0.1", - "@jest/test-result": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/console": "^26.1.0", + "@jest/environment": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.0.1", + "jest-config": "^26.1.0", "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.0.1", - "jest-jasmine2": "^26.0.1", - "jest-leak-detector": "^26.0.1", - "jest-message-util": "^26.0.1", - "jest-resolve": "^26.0.1", - "jest-runtime": "^26.0.1", - "jest-util": "^26.0.1", - "jest-worker": "^26.0.0", + "jest-haste-map": "^26.1.0", + "jest-jasmine2": "^26.1.0", + "jest-leak-detector": "^26.1.0", + "jest-message-util": "^26.1.0", + "jest-resolve": "^26.1.0", + "jest-runtime": "^26.1.0", + "jest-util": "^26.1.0", + "jest-worker": "^26.1.0", "source-map-support": "^0.5.6", "throat": "^5.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "jest-runtime": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.0.1.tgz", - "integrity": "sha512-Ci2QhYFmANg5qaXWf78T2Pfo6GtmIBn2rRaLnklRyEucmPccmCKvS9JPljcmtVamsdMmkyNkVFb9pBTD6si9Lw==", - "dev": true, - "requires": { - "@jest/console": "^26.0.1", - "@jest/environment": "^26.0.1", - "@jest/fake-timers": "^26.0.1", - "@jest/globals": "^26.0.1", - "@jest/source-map": "^26.0.0", - "@jest/test-result": "^26.0.1", - "@jest/transform": "^26.0.1", - "@jest/types": "^26.0.1", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.1.0.tgz", + "integrity": "sha512-1qiYN+EZLmG1QV2wdEBRf+Ci8i3VSfIYLF02U18PiUDrMbhfpN/EAMMkJtT02jgJUoaEOpHAIXG6zS3QRMzRmA==", + "dev": true, + "requires": { + "@jest/console": "^26.1.0", + "@jest/environment": "^26.1.0", + "@jest/fake-timers": "^26.1.0", + "@jest/globals": "^26.1.0", + "@jest/source-map": "^26.1.0", + "@jest/test-result": "^26.1.0", + "@jest/transform": "^26.1.0", + "@jest/types": "^26.1.0", "@types/yargs": "^15.0.0", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.0.1", - "jest-haste-map": "^26.0.1", - "jest-message-util": "^26.0.1", - "jest-mock": "^26.0.1", + "jest-config": "^26.1.0", + "jest-haste-map": "^26.1.0", + "jest-message-util": "^26.1.0", + "jest-mock": "^26.1.0", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.0.1", - "jest-snapshot": "^26.0.1", - "jest-util": "^26.0.1", - "jest-validate": "^26.0.1", + "jest-resolve": "^26.1.0", + "jest-snapshot": "^26.1.0", + "jest-util": "^26.1.0", + "jest-validate": "^26.1.0", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.3.1" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { + "strip-bom": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "jest-serializer": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.0.0.tgz", - "integrity": "sha512-sQGXLdEGWFAE4wIJ2ZaIDb+ikETlUirEOBsLXdoBbeLhTHkZUJwgk3+M8eyFizhM6le43PDCCKPA1hzkSDo4cQ==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.1.0.tgz", + "integrity": "sha512-eqZOQG/0+MHmr25b2Z86g7+Kzd5dG9dhCiUoyUNJPgiqi38DqbDEOlHcNijyfZoj74soGBohKBZuJFS18YTJ5w==", "dev": true, "requires": { "graceful-fs": "^4.2.4" } }, "jest-snapshot": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.0.1.tgz", - "integrity": "sha512-jxd+cF7+LL+a80qh6TAnTLUZHyQoWwEHSUFJjkw35u3Gx+BZUNuXhYvDqHXr62UQPnWo2P6fvQlLjsU93UKyxA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.1.0.tgz", + "integrity": "sha512-YhSbU7eMTVQO/iRbNs8j0mKRxGp4plo7sJ3GzOQ0IYjvsBiwg0T1o0zGQAYepza7lYHuPTrG5J2yDd0CE2YxSw==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.0.1", + "expect": "^26.1.0", "graceful-fs": "^4.2.4", - "jest-diff": "^26.0.1", + "jest-diff": "^26.1.0", "jest-get-type": "^26.0.0", - "jest-matcher-utils": "^26.0.1", - "jest-message-util": "^26.0.1", - "jest-resolve": "^26.0.1", - "make-dir": "^3.0.0", + "jest-haste-map": "^26.1.0", + "jest-matcher-utils": "^26.1.0", + "jest-message-util": "^26.1.0", + "jest-resolve": "^26.1.0", "natural-compare": "^1.4.0", - "pretty-format": "^26.0.1", + "pretty-format": "^26.1.0", "semver": "^7.3.2" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "diff-sequences": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.0.0.tgz", + "integrity": "sha512-JC/eHYEC3aSS0vZGjuoc4vHA0yAQTzhQQldXMeMF+JlxLGJlCO38Gma82NV9gk1jGFz8mDzUMeaKXvjRRdJ2dg==", + "dev": true + }, + "jest-diff": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.1.0.tgz", + "integrity": "sha512-GZpIcom339y0OXznsEKjtkfKxNdg7bVbEofK8Q6MnevTIiR1jNhDWKhRX6X0SDXJlwn3dy59nZ1z55fLkAqPWg==", "dev": true, "requires": { - "color-name": "~1.1.4" + "chalk": "^4.0.0", + "diff-sequences": "^26.0.0", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.1.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, "jest-util": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.0.1.tgz", - "integrity": "sha512-byQ3n7ad1BO/WyFkYvlWQHTsomB6GIewBh8tlGtusiylAlaxQ1UpS0XYH0ngOyhZuHVLN79Qvl6/pMiDMSSG1g==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.1.0.tgz", + "integrity": "sha512-rNMOwFQevljfNGvbzNQAxdmXQ+NawW/J72dmddsK0E8vgxXCMtwQ/EH0BiWEIxh0hhMcTsxwAxINt7Lh46Uzbg==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "is-ci": "^2.0.0", - "make-dir": "^3.0.0" + "micromatch": "^4.0.2" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "jest-validate": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.0.1.tgz", - "integrity": "sha512-u0xRc+rbmov/VqXnX3DlkxD74rHI/CfS5xaV2VpeaVySjbb1JioNVOyly5b56q2l9ZKe7bVG5qWmjfctkQb0bA==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.1.0.tgz", + "integrity": "sha512-WPApOOnXsiwhZtmkDsxnpye+XLb/tUISP+H6cHjfUIXvlG+eKwP+isnivsxlHCPaO9Q5wvbhloIBkdF3qUn+Nw==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^26.1.0", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.0.0", "leven": "^3.1.0", - "pretty-format": "^26.0.1" + "pretty-format": "^26.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "camelcase": { @@ -4276,138 +4768,81 @@ "dev": true }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.0.0.tgz", + "integrity": "sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg==", "dev": true }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "pretty-format": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.1.0.tgz", + "integrity": "sha512-GmeO1PEYdM+non4BKCj+XsPJjFOJIPnsLewqhDVoqY1xo0yNmDas7tC2XwpMrRAHR3MaE2hPo37deX5OisJ2Wg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@jest/types": "^26.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } } } }, "jest-watcher": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.0.1.tgz", - "integrity": "sha512-pdZPydsS8475f89kGswaNsN3rhP6lnC3/QDCppP7bg1L9JQz7oU9Mb/5xPETk1RHDCWeqmVC47M4K5RR7ejxFw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.1.0.tgz", + "integrity": "sha512-ffEOhJl2EvAIki613oPsSG11usqnGUzIiK7MMX6hE4422aXOcVEG3ySCTDFLn1+LZNXGPE8tuJxhp8OBJ1pgzQ==", "dev": true, "requires": { - "@jest/test-result": "^26.0.1", - "@jest/types": "^26.0.1", + "@jest/test-result": "^26.1.0", + "@jest/types": "^26.1.0", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.0.1", + "jest-util": "^26.1.0", "string-length": "^4.0.1" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "@jest/types": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz", + "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, "jest-worker": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.0.0.tgz", - "integrity": "sha512-pPaYa2+JnwmiZjK9x7p9BoZht+47ecFCDFA/CJxspHzeDvQcfVBLWzCiWyo+EGrSiQMWZtCFo9iSvMZnAAo8vw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.1.0.tgz", + "integrity": "sha512-Z9P5pZ6UC+kakMbNJn+tA2RdVdNX5WH1x+5UCBZ9MxIK24pjYtFt96fK+UwBTrjLYm232g1xz0L3eTh51OW+yQ==", "dev": true, "requires": { "merge-stream": "^2.0.0", "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "js-tokens": { @@ -4417,9 +4852,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -4433,9 +4868,9 @@ "dev": true }, "jsdom": { - "version": "16.2.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.2.2.tgz", - "integrity": "sha512-pDFQbcYtKBHxRaP55zGXCJWgFHkDAYbKcsXEK/3Icu9nKYZkutUXfLBwbD+09XDutkYSHcgfQLZ0qvpAAm9mvg==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.3.0.tgz", + "integrity": "sha512-zggeX5UuEknpdZzv15+MS1dPYG0J/TftiiNunOeNxSl3qr8Z6cIlQpN0IdJa44z9aFxZRIVqRncvEhQ7X5DtZg==", "dev": true, "requires": { "abab": "^2.0.3", @@ -4458,7 +4893,7 @@ "tough-cookie": "^3.0.1", "w3c-hr-time": "^1.0.2", "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.0.0", + "webidl-conversions": "^6.1.0", "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.0.0", @@ -4503,12 +4938,12 @@ "dev": true }, "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.0" } }, "jsprim": { @@ -4542,13 +4977,13 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "lines-and-columns": { @@ -4557,13 +4992,26 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -4572,15 +5020,11 @@ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true }, "lodash.sortby": { "version": "4.7.0", @@ -4588,15 +5032,10 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" - }, "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.0.tgz", + "integrity": "sha512-ko6deozZYiAkqa/0gmcsz+p4jSy3gY7/ZsCEokPaYd8k+6/aXGkiTgr61+Owup7Sf+xjqW8u2ElhoM9SEcEfuA==" }, "make-dir": { "version": "3.1.0", @@ -4615,6 +5054,12 @@ } } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "makeerror": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", @@ -4718,19 +5163,13 @@ "requires": { "isobject": "^3.0.1" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -4742,12 +5181,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -4796,9 +5229,9 @@ "dev": true }, "node-notifier": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-7.0.0.tgz", - "integrity": "sha512-y8ThJESxsHcak81PGpzWwQKxzk+5YtP3IxR8AYdpXQ1IB6FmcVzFdZXrkPin49F/DKUCfeeiziB8ptY9npzGuA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-7.0.1.tgz", + "integrity": "sha512-VkzhierE7DBmQEElhTGJIoiZa1oqRijOtgOlsXg32KrJRXsPy0NXFBqWGW/wTswnJlDCs5viRYaqWguqzsKcmg==", "dev": true, "optional": true, "requires": { @@ -4808,25 +5241,6 @@ "shellwords": "^0.1.1", "uuid": "^7.0.3", "which": "^2.0.2" - }, - "dependencies": { - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true, - "optional": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "optional": true, - "requires": { - "isexe": "^2.0.0" - } - } } }, "normalize-package-data": { @@ -4839,6 +5253,14 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "normalize-path": { @@ -4853,6 +5275,13 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { "path-key": "^2.0.0" + }, + "dependencies": { + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + } } }, "nwsapi": { @@ -4898,6 +5327,18 @@ } } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -4905,14 +5346,18 @@ "dev": true, "requires": { "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" } }, "object.pick": { @@ -4922,20 +5367,19 @@ "dev": true, "requires": { "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } } }, - "octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==" + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } }, "once": { "version": "1.4.0", @@ -4955,17 +5399,17 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-name": { @@ -4977,12 +5421,6 @@ "windows-release": "^3.1.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, "p-each-series": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", @@ -4995,27 +5433,27 @@ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "^2.0.0" + "p-try": "^1.0.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^1.1.0" } }, "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "parent-module": { @@ -5028,15 +5466,12 @@ } }, "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" + "error-ex": "^1.2.0" } }, "parse5": { @@ -5052,9 +5487,9 @@ "dev": true }, "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-is-absolute": { @@ -5064,9 +5499,10 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, "path-parse": { "version": "1.0.6", @@ -5074,6 +5510,15 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -5086,6 +5531,12 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, "pirates": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", @@ -5096,12 +5547,12 @@ } }, "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "^4.0.0" + "find-up": "^2.1.0" } }, "posix-character-classes": { @@ -5111,48 +5562,36 @@ "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-format": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.0.1.tgz", - "integrity": "sha512-SWxz6MbupT3ZSlL0Po4WF/KujhQaVehijR2blyRDCzk9e45EaYMVhMBn49fnRuHxtkSpXTes1GxNpVmH86Bxfw==", + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", + "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", "dev": true, "requires": { - "@jest/types": "^26.0.1", + "@jest/types": "^25.5.0", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^16.12.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } } }, "progress": { @@ -5205,34 +5644,24 @@ "dev": true }, "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" } }, "regex-not": { @@ -5246,9 +5675,9 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "remove-trailing-separator": { @@ -5397,16 +5826,6 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -5428,24 +5847,6 @@ "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5566,12 +5967,6 @@ } } }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -5624,9 +6019,10 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true }, "set-blocking": { "version": "2.0.0", @@ -5663,27 +6059,23 @@ "requires": { "isobject": "^3.0.1" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true }, "shellwords": { "version": "0.1.1", @@ -5693,9 +6085,9 @@ "optional": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "sisteransi": { "version": "1.0.5", @@ -5720,10 +6112,28 @@ "is-fullwidth-code-point": "^2.0.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true } } @@ -5833,12 +6243,6 @@ "is-data-descriptor": "^1.0.0", "kind-of": "^6.0.2" } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, @@ -5898,9 +6302,9 @@ "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -5914,9 +6318,9 @@ "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -6013,62 +6417,69 @@ "requires": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^4.1.0" } } } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } + "ansi-regex": "^5.0.0" } }, "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-eof": { @@ -6083,18 +6494,18 @@ "dev": true }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "supports-hyperlinks": { @@ -6105,25 +6516,14 @@ "requires": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, + "svg-element-attributes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/svg-element-attributes/-/svg-element-attributes-1.3.1.tgz", + "integrity": "sha512-Bh05dSOnJBf3miNMqpsormfNtfidA/GxQVakhtn0T4DECWKeXQRQUceYjJ+OxYiiLdGe4Jo9iFV8wICFapFeIA==", + "dev": true + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -6140,31 +6540,6 @@ "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" - }, - "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - } } }, "terminal-link": { @@ -6200,21 +6575,6 @@ "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -6288,12 +6648,68 @@ "punycode": "^2.1.1" } }, + "ts-jest": { + "version": "26.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.1.2.tgz", + "integrity": "sha512-V4SyBDO9gOdEh+AF4KtXJeP+EeI4PkOrxcA8ptl4o8nCXUVM5Gg/8ngGKneS5BsZaR9DXVQNqj9k+iqGAnpGow==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "buffer-from": "1.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "26.x", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "mkdirp": "1.x", + "semver": "7.x", + "yargs-parser": "18.x" + }, + "dependencies": { + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -6315,12 +6731,12 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -6344,6 +6760,12 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -6357,9 +6779,9 @@ } }, "universal-user-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", - "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", + "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", "requires": { "os-name": "^3.1.0" } @@ -6401,12 +6823,6 @@ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true } } }, @@ -6439,15 +6855,15 @@ "optional": true }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, "v8-to-istanbul": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz", - "integrity": "sha512-sAjOC+Kki6aJVbUOXJbcR0MnbfjvBzwKZazEJymA2IX49uoOdEdk+4fBq5cXgYgiyKtAyrrJNtBZdOeDIF+Fng==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.1.4.tgz", + "integrity": "sha512-Rw6vJHj1mbdK8edjR7+zuJrpDtKIgNdAvTSAcpYfgMIw+u2dPDntD3dgN4XQFLU2/fvFQdzj+EeSGfd/jnY5fQ==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.1", @@ -6533,13 +6949,13 @@ "dev": true }, "whatwg-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.0.0.tgz", - "integrity": "sha512-41ou2Dugpij8/LPO5Pq64K5q++MnRCBpEHvQr26/mArEKTkCV5aoXIqyhuYtE0pkqScXwhf2JP57rkRTYM29lQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.1.0.tgz", + "integrity": "sha512-vEIkwNi9Hqt4TV9RdnaBPNt+E2Sgmo3gePebCRgZ1R7g6d23+53zCTnuB0amKI4AXq6VM8jj2DUAa0S1vjJxkw==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", - "tr46": "^2.0.0", + "tr46": "^2.0.2", "webidl-conversions": "^5.0.0" }, "dependencies": { @@ -6552,9 +6968,10 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -6566,9 +6983,9 @@ "dev": true }, "windows-release": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", - "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.1.tgz", + "integrity": "sha512-Pngk/RDCaI/DkuHPlGTdIkDiTAnAkyMjoQMZqRsxydNl1qGXNIoZrB7RK8g53F2tEgQBMqQJHQdYZuQEEAu54A==", "requires": { "execa": "^1.0.0" } @@ -6590,38 +7007,27 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } } } @@ -6653,9 +7059,9 @@ } }, "ws": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz", - "integrity": "sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", "dev": true }, "xml-name-validator": { @@ -6677,9 +7083,9 @@ "dev": true }, "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -6692,7 +7098,81 @@ "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" + "yargs-parser": "^18.1.2" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + } } }, "yargs-parser": { diff --git a/package.json b/package.json index 9fa488cde..86a7cd684 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,25 @@ { "name": "slash-command-dispatch", "version": "1.0.0", + "private": true, "description": "Create repository dispatch events for slash commands", - "main": "src/index.js", + "main": "lib/main.js", "scripts": { - "lint": "eslint src/index.js", - "package": "ncc build src/index.js -o dist", - "test": "eslint src/index.js && jest" + "build": "tsc && ncc build", + "format": "prettier --write '**/*.ts'", + "format-check": "prettier --check '**/*.ts'", + "lint": "eslint src/**/*.ts", + "test": "jest" }, "repository": { "type": "git", "url": "git+https://github.com/peter-evans/slash-command-dispatch.git" }, - "keywords": [], + "keywords": [ + "slash", + "command", + "dispatch" + ], "author": "Peter Evans", "license": "MIT", "bugs": { @@ -21,11 +28,24 @@ "homepage": "https://github.com/peter-evans/slash-command-dispatch#readme", "dependencies": { "@actions/core": "1.2.4", - "@actions/github": "2.1.1" + "@actions/github": "4.0.0", + "@octokit/core": "3.1.0", + "@octokit/plugin-paginate-rest": "2.2.3", + "@octokit/plugin-rest-endpoint-methods": "4.0.0" }, "devDependencies": { - "@zeit/ncc": "0.22.1", - "eslint": "6.8.0", - "jest": "26.0.1" + "@types/jest": "26.0.4", + "@types/node": "14.0.23", + "@typescript-eslint/parser": "3.6.1", + "@zeit/ncc": "0.22.3", + "eslint": "7.4.0", + "eslint-plugin-github": "4.0.1", + "eslint-plugin-jest": "23.18.0", + "jest": "26.1.0", + "jest-circus": "26.1.0", + "js-yaml": "3.14.0", + "prettier": "2.0.5", + "ts-jest": "26.1.2", + "typescript": "3.9.6" } } diff --git a/src/command-helper.ts b/src/command-helper.ts new file mode 100644 index 000000000..7fd560a20 --- /dev/null +++ b/src/command-helper.ts @@ -0,0 +1,246 @@ +import * as core from '@actions/core' +import * as fs from 'fs' +import {inspect} from 'util' +import {Octokit} from './octokit-client' + +const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/ + +export const MAX_ARGS = 50 + +export interface Inputs { + token: string + reactionToken: string + reactions: boolean + commands: string + permission: string + issueType: string + allowEdits: boolean + repository: string + eventTypeSuffix: string + namedArgs: boolean + config: string + configFromFile: string +} + +export interface Command { + command: string + permission: string + issue_type: string + allow_edits: boolean + repository: string + event_type_suffix: string + named_args: boolean +} + +interface Repo { + owner: string + repo: string +} + +export interface SlashCommandPayload { + command: string + args: string + [k: string]: string +} + +export const commandDefaults = Object.freeze({ + permission: 'write', + issue_type: 'both', + allow_edits: false, + repository: process.env.GITHUB_REPOSITORY || '', + event_type_suffix: '-command', + named_args: false +}) + +export function toBool(input: string, defaultVal: boolean): boolean { + if (typeof input === 'boolean') { + return input + } else if (typeof input === 'undefined' || input.length == 0) { + return defaultVal + } else { + return input === 'true' + } +} + +export function getInputs(): Inputs { + // Defaults set in action.yml + return { + token: core.getInput('token'), + reactionToken: core.getInput('reaction-token'), + reactions: core.getInput('reactions') === 'true', + commands: core.getInput('commands'), + permission: core.getInput('permission'), + issueType: core.getInput('issue-type'), + allowEdits: core.getInput('allow-edits') === 'true', + repository: core.getInput('repository'), + eventTypeSuffix: core.getInput('event-type-suffix'), + namedArgs: core.getInput('named-args') === 'true', + config: core.getInput('config'), + configFromFile: core.getInput('config-from-file') + } +} + +export function getCommandsConfig(inputs: Inputs): Command[] { + if (inputs.configFromFile) { + core.info(`Using JSON configuration from file '${inputs.configFromFile}'.`) + const json = fs.readFileSync(inputs.configFromFile, { + encoding: 'utf8' + }) + return getCommandsConfigFromJson(json) + } else if (inputs.config) { + core.info(`Using JSON configuration from 'config' input.`) + return getCommandsConfigFromJson(inputs.config) + } else { + core.info(`Using configuration from yaml inputs.`) + return getCommandsConfigFromInputs(inputs) + } +} + +export function getCommandsConfigFromInputs(inputs: Inputs): Command[] { + // Get commands + const commands = inputs.commands.replace(/\s+/g, '').split(',') + core.debug(`Commands: ${inspect(commands)}`) + + // Build config + const config: Command[] = [] + for (const c of commands) { + const cmd: Command = { + command: c, + permission: inputs.permission, + issue_type: inputs.issueType, + allow_edits: inputs.allowEdits, + repository: inputs.repository, + event_type_suffix: inputs.eventTypeSuffix, + named_args: inputs.namedArgs + } + config.push(cmd) + } + return config +} + +export function getCommandsConfigFromJson(json: string): Command[] { + const jsonConfig = JSON.parse(json) + core.debug(`JSON config: ${inspect(jsonConfig)}`) + + const config: Command[] = [] + for (const jc of jsonConfig) { + const cmd: Command = { + command: jc.command, + permission: jc.permission ? jc.permission : commandDefaults.permission, + issue_type: jc.issue_type ? jc.issue_type : commandDefaults.issue_type, + allow_edits: toBool(jc.allow_edits, commandDefaults.allow_edits), + repository: jc.repository ? jc.repository : commandDefaults.repository, + event_type_suffix: jc.event_type_suffix + ? jc.event_type_suffix + : commandDefaults.event_type_suffix, + named_args: toBool(jc.named_args, commandDefaults.named_args) + } + config.push(cmd) + } + return config +} + +export function configIsValid(config: Command[]): boolean { + for (const command of config) { + if (!['none', 'read', 'write', 'admin'].includes(command.permission)) { + core.setFailed(`'${command.permission}' is not a valid 'permission'.`) + return false + } + if (!['issue', 'pull-request', 'both'].includes(command.issue_type)) { + core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`) + return false + } + } + return true +} + +export function actorHasPermission( + actorPermission: string, + commandPermission: string +): boolean { + const permissionLevels = Object.freeze({ + none: 1, + read: 2, + write: 3, + admin: 4 + }) + core.debug(`Actor permission level: ${permissionLevels[actorPermission]}`) + core.debug(`Command permission level: ${permissionLevels[commandPermission]}`) + return ( + permissionLevels[actorPermission] >= permissionLevels[commandPermission] + ) +} + +export async function getActorPermission( + octokit: InstanceType, + repo: Repo, + actor: string +): Promise { + const { + data: {permission} + } = await octokit.repos.getCollaboratorPermissionLevel({ + ...repo, + username: actor + }) + return permission +} + +export async function addReaction( + octokit: InstanceType, + repo: Repo, + commentId: number, + reaction: + | '+1' + | '-1' + | 'laugh' + | 'confused' + | 'heart' + | 'hooray' + | 'rocket' + | 'eyes' +): Promise { + try { + await octokit.reactions.createForIssueComment({ + ...repo, + comment_id: commentId, + content: reaction + }) + } catch (error) { + core.debug(inspect(error)) + core.warning(`Failed to set reaction on comment ID ${commentId}.`) + } +} + +export function getSlashCommandPayload( + commandWords: string[], + namedArgs: boolean +): SlashCommandPayload { + const payload: SlashCommandPayload = { + command: commandWords[0], + args: '' + } + if (commandWords.length > 1) { + const argWords = commandWords.slice(1, MAX_ARGS + 1) + payload.args = argWords.join(' ') + // Parse named and unnamed args + let unnamedCount = 1 + const unnamedArgs: string[] = [] + for (const argWord of argWords) { + if (namedArgs && NAMED_ARG_PATTERN.test(argWord)) { + const result = NAMED_ARG_PATTERN.exec(argWord) + if (result && result.groups) { + payload[`${result.groups['name']}`] = result.groups['value'] + } + } else { + unnamedArgs.push(argWord) + payload[`arg${unnamedCount}`] = argWord + unnamedCount += 1 + } + } + // Add a string of only the unnamed args + if (namedArgs && unnamedArgs.length > 0) { + payload['unnamed_args'] = unnamedArgs.join(' ') + } + } + return payload +} diff --git a/src/func.js b/src/func.js deleted file mode 100644 index 79382e78c..000000000 --- a/src/func.js +++ /dev/null @@ -1,204 +0,0 @@ -const { inspect } = require("util"); -var fs = require("fs"); -const core = require("@actions/core"); - -const MAX_ARGS = 50; -const namedArgPattern = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/; - -const commandDefaults = Object.freeze({ - permission: "write", - issue_type: "both", - allow_edits: false, - repository: process.env.GITHUB_REPOSITORY, - event_type_suffix: "-command", - named_args: false -}); - -function toBool(input, defaultVal) { - if (typeof input === 'boolean') { - return input; - } else if (typeof input === 'undefined' || input.length == 0) { - return defaultVal; - } else { - return input === "true"; - } -} - -function getInputs() { - return { - token: core.getInput("token"), - reactionToken: core.getInput("reaction-token"), - reactions: toBool(core.getInput("reactions"), true), - commands: core.getInput("commands"), - permission: core.getInput("permission"), - issueType: core.getInput("issue-type"), - allowEdits: core.getInput("allow-edits"), - repository: core.getInput("repository"), - eventTypeSuffix: core.getInput("event-type-suffix"), - namedArgs: core.getInput("named-args"), - config: core.getInput("config"), - configFromFile: core.getInput("config-from-file") - }; -} - -function getCommandsConfig(inputs) { - if (inputs.configFromFile) { - core.info(`Using JSON configuration from file '${inputs.configFromFile}'.`); - return getCommandsConfigFromJson(fs.readFileSync(inputs.configFromFile)); - } else if (inputs.config) { - core.info(`Using JSON configuration from 'config' input.`); - return getCommandsConfigFromJson(inputs.config); - } else { - core.info(`Using configuration from yaml inputs.`); - return getCommandsConfigFromInputs(inputs); - } -} - -function extend(obj1, obj2) { - var result = {}; - for (val in obj1) result[val] = obj1[val]; - for (val in obj2) result[val] = obj2[val]; - return result; -} - -function getCommandsConfigFromInputs(inputs) { - // Get commands - const commands = inputs.commands.replace(/\s+/g, "").split(","); - core.debug(`Commands: ${inspect(commands)}`); - - // Build config - var config = []; - for (const c of commands) { - var cmd = {}; - cmd.command = c; - cmd = extend(commandDefaults, cmd); - cmd.permission = inputs.permission ? inputs.permission : cmd.permission; - cmd.issue_type = inputs.issueType ? inputs.issueType : cmd.issue_type; - cmd.allow_edits = toBool(inputs.allowEdits, cmd.allow_edits); - cmd.repository = inputs.repository ? inputs.repository : cmd.repository; - cmd.event_type_suffix = inputs.eventTypeSuffix - ? inputs.eventTypeSuffix - : cmd.event_type_suffix; - cmd.named_args = toBool(inputs.namedArgs, cmd.named_args); - config.push(cmd); - } - return config; -} - -function getCommandsConfigFromJson(json) { - const jsonConfig = JSON.parse(json); - core.debug(`JSON config: ${inspect(jsonConfig)}`); - - var config = []; - for (const jc of jsonConfig) { - var cmd = {}; - cmd.command = jc.command; - cmd = extend(commandDefaults, cmd); - cmd.permission = jc.permission ? jc.permission : cmd.permission; - cmd.issue_type = jc.issue_type ? jc.issue_type : cmd.issue_type; - cmd.allow_edits = toBool(jc.allow_edits, cmd.allow_edits); - cmd.repository = jc.repository ? jc.repository : cmd.repository; - cmd.event_type_suffix = jc.event_type_suffix - ? jc.event_type_suffix - : cmd.event_type_suffix; - cmd.named_args = toBool(jc.named_args, cmd.named_args); - config.push(cmd); - } - return config; -} - -function configIsValid(config) { - for (const command of config) { - if (!["none", "read", "write", "admin"].includes(command.permission)) { - core.setFailed(`'${command.permission}' is not a valid 'permission'.`); - return false; - } - if (!["issue", "pull-request", "both"].includes(command.issue_type)) { - core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`); - return false; - } - } - return true; -} - -function actorHasPermission(actorPermission, commandPermission) { - const permissionLevels = Object.freeze({ - none: 1, - read: 2, - write: 3, - admin: 4 - }); - core.debug(`Actor permission level: ${permissionLevels[actorPermission]}`); - core.debug( - `Command permission level: ${permissionLevels[commandPermission]}` - ); - return ( - permissionLevels[actorPermission] >= permissionLevels[commandPermission] - ); -} - -async function getActorPermission(octokit, repo, actor) { - const { - data: { permission } - } = await octokit.repos.getCollaboratorPermissionLevel({ - ...repo, - username: actor - }); - return permission; -} - -async function addReaction(octokit, repo, commentId, reaction) { - try { - await octokit.reactions.createForIssueComment({ - ...repo, - comment_id: commentId, - content: reaction - }); - } catch (error) { - core.debug(inspect(error)); - core.warning(`Failed to set reaction on comment ID ${commentId}.`); - } -} - -function getSlashCommandPayload(commandWords, namedArgs) { - var payload = { - command: commandWords[0], - args: "" - }; - if (commandWords.length > 1) { - const argWords = commandWords.slice(1, MAX_ARGS + 1); - payload.args = argWords.join(" "); - // Parse named and unnamed args - var unnamedCount = 1; - var unnamedArgs = []; - for (var argWord of argWords) { - if (namedArgs && namedArgPattern.test(argWord)) { - const { groups: { name, value } } = namedArgPattern.exec(argWord); - payload[`${name}`] = value; - } else { - unnamedArgs.push(argWord) - payload[`arg${unnamedCount}`] = argWord; - unnamedCount += 1; - } - } - // Add a string of only the unnamed args - if (namedArgs && unnamedArgs.length > 0) { - payload["unnamed_args"] = unnamedArgs.join(" "); - } - } - return payload; -} - -module.exports = { - MAX_ARGS, - commandDefaults, - getInputs, - getCommandsConfig, - getCommandsConfigFromInputs, - getCommandsConfigFromJson, - configIsValid, - actorHasPermission, - getActorPermission, - addReaction, - getSlashCommandPayload -}; diff --git a/src/func.test.js b/src/func.test.js deleted file mode 100644 index 164b4ead8..000000000 --- a/src/func.test.js +++ /dev/null @@ -1,202 +0,0 @@ -const { - commandDefaults, - getCommandsConfigFromInputs, - getCommandsConfigFromJson, - actorHasPermission, - configIsValid, - getSlashCommandPayload -} = require("./func"); - -test("building config with required inputs only", async () => { - const inputs = { - commands: "list, of, slash, commands" - }; - const commands = inputs.commands.replace(/\s+/g, "").split(","); - const config = getCommandsConfigFromInputs(inputs); - expect(config.length).toEqual(4); - for (var i = 0; i < config.length; i++) { - expect(config[i].command).toEqual(commands[i]); - expect(config[i].permission).toEqual(commandDefaults.permission); - expect(config[i].issue_type).toEqual(commandDefaults.issue_type); - expect(config[i].allow_edits).toEqual(commandDefaults.allow_edits); - expect(config[i].repository).toEqual(commandDefaults.repository); - expect(config[i].event_type_suffix).toEqual( - commandDefaults.event_type_suffix - ); - expect(config[i].named_args).toEqual(commandDefaults.named_args); - } -}); - -test("building config with optional inputs", async () => { - const inputs = { - commands: "list, of, slash, commands", - permission: "admin", - issueType: "pull-request", - allowEdits: true, - repository: "owner/repo", - eventTypeSuffix: "-cmd", - namedArgs: true - }; - const commands = inputs.commands.replace(/\s+/g, "").split(","); - const config = getCommandsConfigFromInputs(inputs); - expect(config.length).toEqual(4); - for (var i = 0; i < config.length; i++) { - expect(config[i].command).toEqual(commands[i]); - expect(config[i].permission).toEqual(inputs.permission); - expect(config[i].issue_type).toEqual(inputs.issueType); - expect(config[i].allow_edits).toEqual(inputs.allowEdits); - expect(config[i].repository).toEqual(inputs.repository); - expect(config[i].event_type_suffix).toEqual(inputs.eventTypeSuffix); - expect(config[i].named_args).toEqual(inputs.namedArgs); - } -}); - -test("building config with required JSON only", async () => { - const json = `[ - { - "command": "do-stuff" - }, - { - "command": "test-all-the-things" - } - ]`; - const commands = ["do-stuff", "test-all-the-things"]; - const config = getCommandsConfigFromJson(json); - expect(config.length).toEqual(2); - for (var i = 0; i < config.length; i++) { - expect(config[i].command).toEqual(commands[i]); - expect(config[i].permission).toEqual(commandDefaults.permission); - expect(config[i].issue_type).toEqual(commandDefaults.issue_type); - expect(config[i].allow_edits).toEqual(commandDefaults.allow_edits); - expect(config[i].repository).toEqual(commandDefaults.repository); - expect(config[i].event_type_suffix).toEqual( - commandDefaults.event_type_suffix - ); - expect(config[i].named_args).toEqual(commandDefaults.named_args); - } -}); - -test("building config with optional JSON properties", async () => { - const json = `[ - { - "command": "do-stuff", - "permission": "admin", - "issue_type": "pull-request", - "allow_edits": true, - "repository": "owner/repo", - "event_type_suffix": "-cmd", - "named_args": true - }, - { - "command": "test-all-the-things", - "permission": "read" - } - ]`; - const commands = ["do-stuff", "test-all-the-things"]; - const config = getCommandsConfigFromJson(json); - expect(config.length).toEqual(2); - expect(config[0].command).toEqual(commands[0]); - expect(config[0].permission).toEqual("admin"); - expect(config[0].issue_type).toEqual("pull-request"); - expect(config[0].allow_edits).toBeTruthy(); - expect(config[0].repository).toEqual("owner/repo"); - expect(config[0].event_type_suffix).toEqual("-cmd"); - expect(config[0].named_args).toBeTruthy(); - expect(config[1].command).toEqual(commands[1]); - expect(config[1].permission).toEqual("read"); - expect(config[1].issue_type).toEqual(commandDefaults.issue_type); -}); - -test("valid config", async () => { - const config = [ - { - command: "test", - permission: "write", - issue_type: "both", - repository: "peter-evans/slash-command-dispatch", - event_type_suffix: "-command" - } - ]; - expect(configIsValid(config)).toBeTruthy(); -}); - -test("invalid permission level in config", async () => { - const config = [ - { - command: "test", - permission: "test-case-invalid-permission", - issue_type: "both", - repository: "peter-evans/slash-command-dispatch", - event_type_suffix: "-command" - } - ]; - expect(configIsValid(config)).toBeFalsy(); -}); - -test("invalid issue type in config", async () => { - const config = [ - { - command: "test", - permission: "write", - issue_type: "test-case-invalid-issue-type", - repository: "peter-evans/slash-command-dispatch", - event_type_suffix: "-command" - } - ]; - expect(configIsValid(config)).toBeFalsy(); -}); - -test("actor does not have permission", async () => { - expect(actorHasPermission("none", "read")).toBeFalsy(); - expect(actorHasPermission("read", "write")).toBeFalsy(); - expect(actorHasPermission("write", "admin")).toBeFalsy(); -}); - -test("actor has permission", async () => { - expect(actorHasPermission("read", "none")).toBeTruthy(); - expect(actorHasPermission("write", "read")).toBeTruthy(); - expect(actorHasPermission("admin", "write")).toBeTruthy(); - expect(actorHasPermission("write", "write")).toBeTruthy(); -}); - -test("slash command payload", async () => { - commandWords = ["test", "arg1", "arg2", "arg3"]; - payload = { - command: "test", - args: "arg1 arg2 arg3", - arg1: "arg1", - arg2: "arg2", - arg3: "arg3" - }; - expect(getSlashCommandPayload(commandWords)).toEqual(payload); -}); - -test("slash command payload with named args", async () => { - commandWords = ["test", "branch=master", "arg1", "env=prod", "arg2"]; - namedArgs = true; - payload = { - command: "test", - args: "branch=master arg1 env=prod arg2", - unnamed_args: "arg1 arg2", - branch: "master", - env: "prod", - arg1: "arg1", - arg2: "arg2" - }; - expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload); -}); - -test("slash command payload with malformed named args", async () => { - commandWords = ["test", "branch=", "arg1", "e-nv=prod", "arg2"]; - namedArgs = true; - payload = { - command: "test", - args: "branch= arg1 e-nv=prod arg2", - unnamed_args: "branch= arg1 e-nv=prod arg2", - arg1: "branch=", - arg2: "arg1", - arg3: "e-nv=prod", - arg4: "arg2" - }; - expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload); -}); diff --git a/src/index.js b/src/main.ts similarity index 52% rename from src/index.js rename to src/main.ts index 0a8500856..dabfccbe7 100644 --- a/src/index.js +++ b/src/main.ts @@ -1,7 +1,7 @@ -const { inspect } = require("util"); -const core = require("@actions/core"); -const github = require("@actions/github"); -const { +import * as core from '@actions/core' +import * as github from '@actions/github' +import {inspect} from 'util' +import { getInputs, getCommandsConfig, configIsValid, @@ -9,144 +9,150 @@ const { getActorPermission, addReaction, getSlashCommandPayload -} = require("./func"); +} from './command-helper' +import {Octokit} from './octokit-client' -async function run() { +async function run(): Promise { try { + // Check required context properties exist (satisfy type checking) + if ( + !github.context.payload.action || + !github.context.payload.issue || + !github.context.payload.comment + ) { + throw new Error('Required context properties are missing.') + } + // Only handle 'created' and 'edited' event types - if (!["created", "edited"].includes(github.context.payload.action)) { + if (!['created', 'edited'].includes(github.context.payload.action)) { core.warning( `Event type '${github.context.payload.action}' not supported.` - ); - return; + ) + return } // Get action inputs - const inputs = getInputs(); - core.debug(`Inputs: ${inspect(inputs)}`); + const inputs = getInputs() + core.debug(`Inputs: ${inspect(inputs)}`) // Check required inputs if (!inputs.token) { - core.setFailed("Missing required input 'token'."); - return false; + throw new Error(`Missing required input 'token'.`) } // Get configuration for registered commands - const config = getCommandsConfig(inputs); - core.debug(`Commands config: ${inspect(config)}`); + const config = getCommandsConfig(inputs) + core.debug(`Commands config: ${inspect(config)}`) // Check the config is valid - if (!configIsValid(config)) return; + if (!configIsValid(config)) return // Get the comment body and id - const commentBody = github.context.payload["comment"]["body"]; - const commentId = github.context.payload["comment"]["id"]; - core.debug(`Comment body: ${commentBody}`); - core.debug(`Comment id: ${commentId}`); + const commentBody: string = github.context.payload.comment.body + const commentId: number = github.context.payload.comment.id + core.debug(`Comment body: ${commentBody}`) + core.debug(`Comment id: ${commentId}`) // Check if the first line of the comment is a slash command - const firstLine = commentBody.split(/\r?\n/)[0].trim(); - if (firstLine.length < 2 || firstLine.charAt(0) != "/") { - console.debug("The first line of the comment is not a valid slash command."); - return; + const firstLine = commentBody.split(/\r?\n/)[0].trim() + if (firstLine.length < 2 || firstLine.charAt(0) != '/') { + console.debug( + 'The first line of the comment is not a valid slash command.' + ) + return } // Split the first line into "words" - const commandWords = firstLine.slice(1).split(" "); - core.debug(`Command words: ${inspect(commandWords)}`); + const commandWords = firstLine.slice(1).split(' ') + core.debug(`Command words: ${inspect(commandWords)}`) // Check if the command is registered for dispatch - var configMatches = config.filter(function(cmd) { - return cmd.command == commandWords[0]; - }); - core.debug(`Config matches on 'command': ${inspect(configMatches)}`); + let configMatches = config.filter(function (cmd) { + return cmd.command == commandWords[0] + }) + core.debug(`Config matches on 'command': ${inspect(configMatches)}`) if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not registered for dispatch.`); - return; + core.info(`Command '${commandWords[0]}' is not registered for dispatch.`) + return } // Filter matching commands by issue type - const isPullRequest = "pull_request" in github.context.payload.issue; - configMatches = configMatches.filter(function(cmd) { + const isPullRequest = 'pull_request' in github.context.payload.issue + configMatches = configMatches.filter(function (cmd) { return ( - cmd.issue_type == "both" || - (cmd.issue_type == "issue" && !isPullRequest) || - (cmd.issue_type == "pull-request" && isPullRequest) - ); - }); - core.debug(`Config matches on 'issue_type': ${inspect(configMatches)}`); + cmd.issue_type == 'both' || + (cmd.issue_type == 'issue' && !isPullRequest) || + (cmd.issue_type == 'pull-request' && isPullRequest) + ) + }) + core.debug(`Config matches on 'issue_type': ${inspect(configMatches)}`) if (configMatches.length == 0) { - const issueType = isPullRequest ? "pull request" : "issue"; + const issueType = isPullRequest ? 'pull request' : 'issue' core.info( `Command '${commandWords[0]}' is not configured for the issue type '${issueType}'.` - ); - return; + ) + return } // Filter matching commands by whether or not to allow edits - if (github.context.payload.action == "edited") { - configMatches = configMatches.filter(function(cmd) { - return cmd.allow_edits; - }); - core.debug(`Config matches on 'allow_edits': ${inspect(configMatches)}`); + if (github.context.payload.action == 'edited') { + configMatches = configMatches.filter(function (cmd) { + return cmd.allow_edits + }) + core.debug(`Config matches on 'allow_edits': ${inspect(configMatches)}`) if (configMatches.length == 0) { core.info( `Command '${commandWords[0]}' is not configured to allow edits.` - ); - return; + ) + return } } // Set octokit clients - const octokit = new github.GitHub(inputs.token); - const reactionOctokit = new github.GitHub(inputs.reactionToken) + const octokit = new Octokit({auth: `${inputs.token}`}) + const reactionOctokit = new Octokit({auth: `${inputs.reactionToken}`}) // At this point we know the command is registered // Add the "eyes" reaction to the comment if (inputs.reactions) - await addReaction( - reactionOctokit, - github.context.repo, - commentId, - "eyes" - ); + await addReaction(reactionOctokit, github.context.repo, commentId, 'eyes') // Get the actor permission const actorPermission = await getActorPermission( octokit, github.context.repo, github.context.actor - ); - core.debug(`Actor permission: ${actorPermission}`); + ) + core.debug(`Actor permission: ${actorPermission}`) // Filter matching commands by the user's permission level - configMatches = configMatches.filter(function(cmd) { - return actorHasPermission(actorPermission, cmd.permission); - }); - core.debug(`Config matches on 'permission': ${inspect(configMatches)}`); + configMatches = configMatches.filter(function (cmd) { + return actorHasPermission(actorPermission, cmd.permission) + }) + core.debug(`Config matches on 'permission': ${inspect(configMatches)}`) if (configMatches.length == 0) { core.info( `Command '${commandWords[0]}' is not configured for the user's permission level '${actorPermission}'.` - ); - return; + ) + return } // Determined that the command should be dispatched - core.info(`Command '${commandWords[0]}' to be dispatched.`); + core.info(`Command '${commandWords[0]}' to be dispatched.`) // Define payload - var clientPayload = { + const clientPayload = { slash_command: {}, github: github.context - }; + } // Get the pull request context for the dispatch payload if (isPullRequest) { - const { data: pullRequest } = await octokit.pulls.get({ + const {data: pullRequest} = await octokit.pulls.get({ ...github.context.repo, pull_number: github.context.payload.issue.number - }); - clientPayload["pull_request"] = pullRequest; + }) + clientPayload['pull_request'] = pullRequest } // Dispatch for each matching configuration @@ -155,23 +161,23 @@ async function run() { clientPayload.slash_command = getSlashCommandPayload( commandWords, cmd.named_args - ); + ) core.debug( `Slash command payload: ${inspect(clientPayload.slash_command)}` - ); + ) // Dispatch the command - const dispatchRepo = cmd.repository.split("/"); - const eventType = cmd.command + cmd.event_type_suffix; + const dispatchRepo = cmd.repository.split('/') + const eventType = cmd.command + cmd.event_type_suffix await octokit.repos.createDispatchEvent({ owner: dispatchRepo[0], repo: dispatchRepo[1], event_type: eventType, client_payload: clientPayload - }); + }) core.info( `Command '${cmd.command}' dispatched to '${cmd.repository}' ` + `with event type '${eventType}'.` - ); + ) } // Add the "rocket" reaction to the comment @@ -180,12 +186,12 @@ async function run() { reactionOctokit, github.context.repo, commentId, - "rocket" - ); + 'rocket' + ) } catch (error) { - core.debug(inspect(error)); - core.setFailed(error.message); + core.debug(inspect(error)) + core.setFailed(error.message) } } -run(); +run() diff --git a/src/octokit-client.ts b/src/octokit-client.ts new file mode 100644 index 000000000..5e82c5d6b --- /dev/null +++ b/src/octokit-client.ts @@ -0,0 +1,7 @@ +import {Octokit as Core} from '@octokit/core' +import {paginateRest} from '@octokit/plugin-paginate-rest' +import {restEndpointMethods} from '@octokit/plugin-rest-endpoint-methods' +export {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods' +export {OctokitOptions} from '@octokit/core/dist-types/types' + +export const Octokit = Core.plugin(paginateRest, restEndpointMethods) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..1f0f0044e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es6" + ], + "outDir": "./lib", + "rootDir": "./src", + "declaration": true, + "strict": true, + "noImplicitAny": false, + "esModuleInterop": true + }, + "exclude": ["__test__", "lib", "node_modules"] +} From dde66842e85fa8ccf6c1a68fc6bd5ece73d152fb Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 20 Jul 2020 17:24:08 +0900 Subject: [PATCH 02/33] Truncate body context properties --- README.md | 9 ++++++--- __test__/command-helper.test.ts | 2 +- dist/index.js | 7 +++++++ docs/advanced-configuration.md | 6 +++--- docs/getting-started.md | 2 +- docs/updating.md | 9 +++++++++ src/main.ts | 12 ++++++++++++ 7 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 docs/updating.md diff --git a/README.md b/README.md index ad576e40e..59183f64b 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ See it in action with the following live demos. - [Examples](docs/examples.md) - [Standard configuration](#standard-configuration) - [Advanced configuration](docs/advanced-configuration.md) +- [Updating to v2](docs/updating.md) ## Dispatching commands @@ -49,7 +50,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commands: deploy, integration-test, build-docs @@ -90,7 +91,7 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c ```yml - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} reaction-token: ${{ secrets.REPO_ACCESS_TOKEN }} @@ -172,7 +173,7 @@ These named arguments can be accessed in a workflow as follows. #### `github` and `pull_request` contexts -The payload contains the complete `github` context of the `issue_comment` event at path `github.event.client_payload.github`. +The payload contains the `github` context of the `issue_comment` event at path `github.event.client_payload.github`. Additionally, if the comment was made in a pull request, the action calls the [GitHub API to fetch the pull request detail](https://developer.github.com/v3/pulls/#get-a-single-pull-request) and attach it to the payload at path `github.event.client_payload.pull_request`. You can inspect the payload with the following step. @@ -183,6 +184,8 @@ You can inspect the payload with the following step. run: echo "$PAYLOAD_CONTEXT" ``` +Note that the `client_payload.github.payload.issue.body` and `client_payload.pull_request.body` context properties will be truncated if they exceed 1000 characters. + ### Responding to the comment on command completion Using [create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) action there are a number of ways you can respond to the comment once the command has completed. diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index 5fc0c840d..4b7f295ee 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -20,7 +20,7 @@ describe('command-helper tests', () => { permission: 'write', issueType: 'both', allowEdits: false, - // Should be process.env.GITHUB_REPOSITORY, but '' for tests + // Should be the value of github.repository, but '' for tests repository: '', eventTypeSuffix: '-command', namedArgs: false, diff --git a/dist/index.js b/dist/index.js index e55fb095f..5bf3dc19e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1202,9 +1202,16 @@ function run() { slash_command: {}, github: github.context }; + // Truncate the body to keep the size of the payload under the max + if (clientPayload.github.payload.issue && + clientPayload.github.payload.issue.body) { + clientPayload.github.payload.issue.body = clientPayload.github.payload.issue.body.slice(0, 1000); + } // Get the pull request context for the dispatch payload if (isPullRequest) { const { data: pullRequest } = yield octokit.pulls.get(Object.assign(Object.assign({}, github.context.repo), { pull_number: github.context.payload.issue.number })); + // Truncate the body to keep the size of the payload under the max + pullRequest.body = pullRequest.body.slice(0, 1000); clientPayload['pull_request'] = pullRequest; } // Dispatch for each matching configuration diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index 95e66d809..666344a6e 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -8,7 +8,7 @@ For example, the following basic configuration means that all commands must have ```yml - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commands: deploy, integration-test, build-docs @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} config: > @@ -77,7 +77,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} config-from-file: .github/slash-command-dispatch.json diff --git a/docs/getting-started.md b/docs/getting-started.md index 420a4937c..a4866f1eb 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -56,7 +56,7 @@ Command processing setup is complete! Now we need to setup command dispatch for runs-on: ubuntu-latest steps: - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commands: example diff --git a/docs/updating.md b/docs/updating.md new file mode 100644 index 000000000..80a559af0 --- /dev/null +++ b/docs/updating.md @@ -0,0 +1,9 @@ +## Updating from `v1` to `v2` + +### Breaking changes + +- The `client_payload.github.payload.issue.body` and `client_payload.pull_request.body` context properties will now be truncated if they exceed 1000 characters. + +### New features + +- diff --git a/src/main.ts b/src/main.ts index dabfccbe7..743abcb45 100644 --- a/src/main.ts +++ b/src/main.ts @@ -145,6 +145,16 @@ async function run(): Promise { slash_command: {}, github: github.context } + // Truncate the body to keep the size of the payload under the max + if ( + clientPayload.github.payload.issue && + clientPayload.github.payload.issue.body + ) { + clientPayload.github.payload.issue.body = clientPayload.github.payload.issue.body.slice( + 0, + 1000 + ) + } // Get the pull request context for the dispatch payload if (isPullRequest) { @@ -152,6 +162,8 @@ async function run(): Promise { ...github.context.repo, pull_number: github.context.payload.issue.number }) + // Truncate the body to keep the size of the payload under the max + pullRequest.body = pullRequest.body.slice(0, 1000) clientPayload['pull_request'] = pullRequest } From 9a49db791a04bafc8be87b97ac86addd1c08cca4 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 20 Jul 2020 17:42:59 +0900 Subject: [PATCH 03/33] Updated dependencies --- dist/index.js | 3874 ++------------------------------------------- package-lock.json | 144 +- package.json | 16 +- 3 files changed, 187 insertions(+), 3847 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5bf3dc19e..f305f10aa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,161 +49,6 @@ module.exports = /************************************************************************/ /******/ ({ -/***/ 2: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const os = __webpack_require__(87); -const macosRelease = __webpack_require__(118); -const winRelease = __webpack_require__(49); - -const osName = (platform, release) => { - if (!platform && release) { - throw new Error('You can\'t specify a `release` without specifying `platform`'); - } - - platform = platform || os.platform(); - - let id; - - if (platform === 'darwin') { - if (!release && os.platform() === 'darwin') { - release = os.release(); - } - - const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS'; - id = release ? macosRelease(release).name : ''; - return prefix + (id ? ' ' + id : ''); - } - - if (platform === 'linux') { - if (!release && os.platform() === 'linux') { - release = os.release(); - } - - id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : ''; - return 'Linux' + (id ? ' ' + id : ''); - } - - if (platform === 'win32') { - if (!release && os.platform() === 'win32') { - release = os.release(); - } - - id = release ? winRelease(release) : ''; - return 'Windows' + (id ? ' ' + id : ''); - } - - return platform; -}; - -module.exports = osName; - - -/***/ }), - -/***/ 9: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var once = __webpack_require__(969); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - process.nextTick(onclosenexttick); - }; - - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - - -/***/ }), - /***/ 11: /***/ (function(module) { @@ -242,73 +87,6 @@ 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, -}; - - /***/ }), /***/ 16: @@ -329,200 +107,47 @@ module.exports = eval("require")("encoding"); /***/ 49: /***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; - -const os = __webpack_require__(87); -const execa = __webpack_require__(955); - -// Reference: https://www.gaijin.at/en/lstwinver.php -const names = new Map([ - ['10.0', '10'], - ['6.3', '8.1'], - ['6.2', '8'], - ['6.1', '7'], - ['6.0', 'Vista'], - ['5.2', 'Server 2003'], - ['5.1', 'XP'], - ['5.0', '2000'], - ['4.9', 'ME'], - ['4.1', '98'], - ['4.0', '95'] -]); - -const windowsRelease = release => { - const version = /\d+\.\d/.exec(release || os.release()); - - if (release && !version) { - throw new Error('`release` argument doesn\'t match `n.n`'); - } - - const ver = (version || [])[0]; - - // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime. - // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version - // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx - // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead. - // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name. - if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) { - let stdout; - try { - stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || ''; - } catch (_) { - stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || ''; - } - - const year = (stdout.match(/2008|2012|2016|2019/) || [])[0]; - - if (year) { - return `Server ${year}`; - } - } - - return names.get(ver); -}; - -module.exports = windowsRelease; - - -/***/ }), - -/***/ 55: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = which -which.sync = whichSync - -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' - -var path = __webpack_require__(622) -var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(742) - -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' - - return er -} - -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - pathEnv = pathEnv.split(colon) - - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) - - - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } +var wrappy = __webpack_require__(11) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } -} + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } - - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) + f.called = false + return f } -function whichSync (cmd, opt) { - opt = opt || {} - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) } - - if (opt.all && found.length) - return found - - if (opt.nothrow) - return null - - throw getNotFoundError(cmd) + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f } @@ -533,50 +158,6 @@ function whichSync (cmd, opt) { module.exports = require("os"); -/***/ }), - -/***/ 118: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const os = __webpack_require__(87); - -const nameMap = new Map([ - [20, ['Big Sur', '11']], - [19, ['Catalina', '10.15']], - [18, ['Mojave', '10.14']], - [17, ['High Sierra', '10.13']], - [16, ['Sierra', '10.12']], - [15, ['El Capitan', '10.11']], - [14, ['Yosemite', '10.10']], - [13, ['Mavericks', '10.9']], - [12, ['Mountain Lion', '10.8']], - [11, ['Lion', '10.7']], - [10, ['Snow Leopard', '10.6']], - [9, ['Leopard', '10.5']], - [8, ['Tiger', '10.4']], - [7, ['Panther', '10.3']], - [6, ['Jaguar', '10.2']], - [5, ['Puma', '10.1']] -]); - -const macosRelease = release => { - release = Number((release || os.release()).split('.')[0]); - - const [name, version] = nameMap.get(release); - - return { - name, - version - }; -}; - -module.exports = macosRelease; -// TODO: remove this in the next major version -module.exports.default = macosRelease; - - /***/ }), /***/ 127: @@ -629,13 +210,6 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), -/***/ 129: -/***/ (function(module) { - -module.exports = require("child_process"); - -/***/ }), - /***/ 141: /***/ (function(__unusedmodule, exports, __webpack_require__) { @@ -908,163 +482,8 @@ exports.debug = debug; // for test /***/ }), -/***/ 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); - - 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; - - -/***/ }), - -/***/ 168: -/***/ (function(module) { - -"use strict"; - -const alias = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => alias.some(x => Boolean(opts[x])); - -module.exports = opts => { - if (!opts) { - return null; - } - - if (opts.stdio && hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); - } - - if (typeof opts.stdio === 'string') { - return opts.stdio; - } - - const stdio = opts.stdio || []; - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const result = []; - const len = Math.max(stdio.length, alias.length); - - for (let i = 0; i < len; i++) { - let value = null; - - if (stdio[i] !== undefined) { - value = stdio[i]; - } else if (opts[alias[i]] !== undefined) { - value = opts[alias[i]]; - } - - result[i] = value; - } - - return result; -}; - - -/***/ }), - -/***/ 197: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(747) - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() - - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - - return ret -} - - -/***/ }), - -/***/ 198: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/***/ 198: +/***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; @@ -1251,176 +670,6 @@ run(); module.exports = require("https"); -/***/ }), - -/***/ 260: -/***/ (function(module, __unusedexports, __webpack_require__) { - -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -var assert = __webpack_require__(357) -var signals = __webpack_require__(654) -var isWin = /^win/i.test(process.platform) - -var EE = __webpack_require__(614) -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter -} - -var emitter -if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__ -} else { - emitter = process.__signal_exit_emitter__ = new EE() - emitter.count = 0 - emitter.emitted = {} -} - -// Because this emitter is a global, we have to check to see if a -// previous version of this library failed to enable infinite listeners. -// I know what you're about to say. But literally everything about -// signal-exit is a compromise with evil. Get used to it. -if (!emitter.infinite) { - emitter.setMaxListeners(Infinity) - emitter.infinite = true -} - -module.exports = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') - - if (loaded === false) { - load() - } - - var ev = 'exit' - if (opts && opts.alwaysLast) { - ev = 'afterexit' - } - - var remove = function () { - emitter.removeListener(ev, cb) - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload() - } - } - emitter.on(ev, cb) - - return remove -} - -module.exports.unload = unload -function unload () { - if (!loaded) { - return - } - loaded = false - - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 -} - -function emit (event, code, signal) { - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) -} - -// { : , ... } -var sigListeners = {} -signals.forEach(function (sig) { - sigListeners[sig] = function listener () { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig) - if (listeners.length === emitter.count) { - unload() - emit('exit', null, sig) - /* istanbul ignore next */ - emit('afterexit', null, sig) - /* istanbul ignore next */ - if (isWin && sig === 'SIGHUP') { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - sig = 'SIGINT' - } - process.kill(process.pid, sig) - } - } -}) - -module.exports.signals = function () { - return signals -} - -module.exports.load = load - -var loaded = false - -function load () { - if (loaded) { - return - } - loaded = true - - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1 - - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) - - process.emit = processEmit - process.reallyExit = processReallyExit -} - -var originalProcessReallyExit = process.reallyExit -function processReallyExit (code) { - process.exitCode = code || 0 - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode) -} - -var originalProcessEmit = process.emit -function processEmit (ev, arg) { - if (ev === 'exit') { - if (arg !== undefined) { - process.exitCode = arg - } - var ret = originalProcessEmit.apply(this, arguments) - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - return ret - } else { - return originalProcessEmit.apply(this, arguments) - } -} - - /***/ }), /***/ 262: @@ -1651,75 +900,6 @@ exports.paginateRest = paginateRest; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 323: -/***/ (function(module) { - -"use strict"; - - -var isStream = module.exports = function (stream) { - return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; -}; - -isStream.writable = function (stream) { - return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; -}; - -isStream.readable = function (stream) { - return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; -}; - -isStream.duplex = function (stream) { - return isStream.writable(stream) && isStream.readable(stream); -}; - -isStream.transform = function (stream) { - return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; -}; - - /***/ }), /***/ 357: @@ -1959,7 +1139,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var isPlainObject = _interopDefault(__webpack_require__(696)); -var universalUserAgent = __webpack_require__(562); +var universalUserAgent = __webpack_require__(796); function lowercaseKeys(object) { if (!object) { @@ -2333,32 +1513,6 @@ exports.endpoint = endpoint; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 392: -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - - return ""; -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - /***/ }), /***/ 413: @@ -2367,53 +1521,6 @@ exports.getUserAgent = getUserAgent; module.exports = __webpack_require__(141); -/***/ }), - -/***/ 427: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -// Older verions of Node.js might not have `util.getSystemErrorName()`. -// In that case, fall back to a deprecated internal. -const util = __webpack_require__(669); - -let uv; - -if (typeof util.getSystemErrorName === 'function') { - module.exports = util.getSystemErrorName; -} else { - try { - uv = process.binding('uv'); - - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } - } catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; - } - - module.exports = code => errname(uv, code); -} - -// Used for testing the fallback behavior -module.exports.__test__ = errname; - -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } - - if (!(code < 0)) { - throw new Error('err >= 0'); - } - - return `Unknown system error ${code}`; -} - - - /***/ }), /***/ 431: @@ -2578,7 +1685,7 @@ function _objectSpread2(target) { return target; } -const VERSION = "3.1.0"; +const VERSION = "3.1.1"; class Octokit { constructor(options = {}) { @@ -2697,95 +1804,6 @@ exports.Octokit = Octokit; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 453: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var once = __webpack_require__(969) -var eos = __webpack_require__(9) -var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes - -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' -} - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} - -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} - -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) - - var closed = false - stream.on('close', function () { - closed = true - }) - - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true - - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - - if (isFn(stream.destroy)) return stream.destroy() - - callback(err || new Error('stream was destroyed')) - } -} - -var call = function (fn) { - fn() -} - -var pipe = function (from, to) { - return from.pipe(to) -} - -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') - - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - - return streams.reduce(pipe) -} - -module.exports = pump - - /***/ }), /***/ 454: @@ -4449,7 +3467,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var deprecation = __webpack_require__(692); -var once = _interopDefault(__webpack_require__(969)); +var once = _interopDefault(__webpack_require__(49)); const logOnce = once(deprecation => console.warn(deprecation)); /** @@ -4771,16 +3789,6 @@ function getState(name) { exports.getState = getState; //# sourceMappingURL=core.js.map -/***/ }), - -/***/ 473: -/***/ (function(module) { - -"use strict"; - -module.exports = /^#!.*/; - - /***/ }), /***/ 510: @@ -5500,62 +4508,42 @@ exports.HttpClient = HttpClient; /***/ }), -/***/ 542: -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 605: +/***/ (function(module) { -"use strict"; +module.exports = require("http"); +/***/ }), -const path = __webpack_require__(622); -const which = __webpack_require__(55); -const pathKey = __webpack_require__(565)(); +/***/ 614: +/***/ (function(module) { -function resolveCommandAttempt(parsed, withoutPathExt) { - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; +module.exports = require("events"); - // 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; +/***/ 622: +/***/ (function(module) { - 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); - } +module.exports = require("path"); - // 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; -} +/***/ 631: +/***/ (function(module) { -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); -} +module.exports = require("net"); + +/***/ }), -module.exports = resolveCommand; +/***/ 669: +/***/ (function(module) { +module.exports = require("util"); /***/ }), -/***/ 562: +/***/ 692: /***/ (function(__unusedmodule, exports) { "use strict"; @@ -5563,1717 +4551,17 @@ module.exports = resolveCommand; Object.defineProperty(exports, '__esModule', { value: true }); -function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - - return ""; -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 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'; -}; - - -/***/ }), - -/***/ 605: -/***/ (function(module) { - -module.exports = require("http"); - -/***/ }), - -/***/ 607: -/***/ (function(module, exports) { - -exports = module.exports = SemVer - -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} -} - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' - -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 - -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var R = 0 - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++ -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' -var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++ -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')' - -var MAINVERSIONLOOSE = R++ -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')' - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++ -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')' - -var PRERELEASEIDENTIFIERLOOSE = R++ -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')' - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++ -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' - -var PRERELEASELOOSE = R++ -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++ -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++ -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?' - -src[FULL] = '^' + FULLPLAIN + '$' - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?' - -var LOOSE = R++ -src[LOOSE] = '^' + LOOSEPLAIN + '$' - -var GTLT = R++ -src[GTLT] = '((?:<|>)?=?)' - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++ -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -var XRANGEIDENTIFIER = R++ -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' - -var XRANGEPLAIN = R++ -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?' - -var XRANGEPLAINLOOSE = R++ -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?' - -var XRANGE = R++ -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' -var XRANGELOOSE = R++ -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++ -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++ -src[LONETILDE] = '(?:~>?)' - -var TILDETRIM = R++ -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') -var tildeTrimReplace = '$1~' - -var TILDE = R++ -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' -var TILDELOOSE = R++ -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++ -src[LONECARET] = '(?:\\^)' - -var CARETTRIM = R++ -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') -var caretTrimReplace = '$1^' - -var CARET = R++ -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' -var CARETLOOSE = R++ -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++ -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' -var COMPARATOR = R++ -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++ -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++ -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$' - -var HYPHENRANGELOOSE = R++ -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$' - -// Star ranges basically just allow anything at all. -var STAR = R++ -src[STAR] = '(<|>)?=?\\s*\\*' - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} - -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - var r = options.loose ? re[LOOSE] : re[FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} - -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} - -exports.SemVer = SemVer - -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } - - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) - - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() -} - -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} - -SemVer.prototype.toString = function () { - return this.version -} - -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return this.compareMain(other) || this.comparePre(other) -} - -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} - -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} - -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } - - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} - -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} - -exports.compareIdentifiers = compareIdentifiers - -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} - -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} - -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} - -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} - -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} - -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} - -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} - -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compare(a, b, loose) - }) -} - -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.rcompare(a, b, loose) - }) -} - -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} - -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} - -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 -} - -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} - -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} - -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} - -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b - - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError('Invalid operator: ' + op) - } -} - -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } - - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) -} - -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var m = comp.match(r) - - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } - - this.operator = m[1] - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} - -Comparator.prototype.toString = function () { - return this.value -} - -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY) { - return true - } - - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } - - return cmp(version, this.operator, this.semver, this.options) -} - -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - var rangeTmp - - if (this.operator === '') { - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} - -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - return new Range(range.value, options) - } - - if (!(this instanceof Range)) { - return new Range(range, options) - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } - - this.format() -} - -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} - -Range.prototype.toString = function () { - return this.range -} - -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[COMPARATORTRIM]) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - - return set -} - -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some(function (thisComparators) { - return thisComparators.every(function (thisComparator) { - return range.set.some(function (rangeComparators) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - }) - }) -} - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} - -function replaceTilde (comp, options) { - var r = options.loose ? re[TILDELOOSE] : re[TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} - -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[CARETLOOSE] : re[CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } - - debug('caret return', ret) - return ret - }) -} - -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} - -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - ret = gtlt + M + '.' + m + '.' + p - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], '') -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } - - return (from + ' ' + to).trim() -} - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} - -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} - -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} - -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} - -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} - -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} - -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) - - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - var high = null - var low = null - - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} - -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} - -exports.coerce = coerce -function coerce (version) { - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - var match = version.match(re[COERCE]) - - if (match == null) { - return null - } - - return parse(match[1] + - '.' + (match[2] || '0') + - '.' + (match[3] || '0')) -} - - -/***/ }), - -/***/ 614: -/***/ (function(module) { - -module.exports = require("events"); - -/***/ }), - -/***/ 621: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const path = __webpack_require__(622); -const pathKey = __webpack_require__(682); - -module.exports = opts => { - opts = Object.assign({ - cwd: process.cwd(), - path: process.env[pathKey()] - }, opts); - - let prev; - let pth = path.resolve(opts.cwd); - const ret = []; - - while (prev !== pth) { - ret.push(path.join(pth, 'node_modules/.bin')); - prev = pth; - pth = path.resolve(pth, '..'); - } - - // ensure the running `node` binary is used - ret.push(path.dirname(process.execPath)); - - return ret.concat(opts.path).join(path.delimiter); -}; - -module.exports.env = opts => { - opts = Object.assign({ - env: process.env - }, opts); - - const env = Object.assign({}, opts.env); - const path = pathKey({env}); - - opts.path = env[path]; - env[path] = module.exports(opts); - - return env; -}; - - -/***/ }), - -/***/ 622: -/***/ (function(module) { - -module.exports = require("path"); - -/***/ }), - -/***/ 631: -/***/ (function(module) { - -module.exports = require("net"); - -/***/ }), - -/***/ 654: -/***/ (function(module) { - -// This is not the set of all possible signals. -// -// It IS, however, the set of all signals that trigger -// an exit on either Linux or BSD systems. Linux is a -// superset of the signal names supported on BSD, and -// the unknown signals just fail to register, so we can -// catch that easily enough. -// -// Don't bother with SIGKILL. It's uncatchable, which -// means that we can't fire any callbacks anyway. -// -// If a user does happen to register a handler on a non- -// fatal signal like SIGWINCH or something, and then -// exit, it'll end up firing `process.emit('exit')`, so -// the handler will be fired anyway. -// -// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised -// artificially, inherently leave the process in a -// state from which it is not safe to try and enter JS -// listeners. -module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' -] - -if (process.platform !== 'win32') { - module.exports.push( - 'SIGVTALRM', - 'SIGXCPU', - 'SIGXFSZ', - 'SIGUSR2', - 'SIGTRAP', - 'SIGSYS', - 'SIGQUIT', - 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ) -} - -if (process.platform === 'linux') { - module.exports.push( - 'SIGIO', - 'SIGPOLL', - 'SIGPWR', - 'SIGSTKFLT', - 'SIGUNUSED' - ) -} - - -/***/ }), - -/***/ 669: -/***/ (function(module) { - -module.exports = require("util"); - -/***/ }), - -/***/ 682: -/***/ (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'; -}; - - -/***/ }), - -/***/ 692: -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = 'Deprecation'; } } @@ -7337,93 +4625,6 @@ function isPlainObject(o) { module.exports = isPlainObject; -/***/ }), - -/***/ 697: -/***/ (function(module) { - -"use strict"; - -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); - - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); -}; - - -/***/ }), - -/***/ 742: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var fs = __webpack_require__(747) -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(818) -} else { - core = __webpack_require__(197) -} - -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} - -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} - - /***/ }), /***/ 747: @@ -7444,7 +4645,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var endpoint = __webpack_require__(385); -var universalUserAgent = __webpack_require__(392); +var universalUserAgent = __webpack_require__(796); var isPlainObject = _interopDefault(__webpack_require__(696)); var nodeFetch = _interopDefault(__webpack_require__(454)); var requestError = __webpack_require__(463); @@ -7587,59 +4788,6 @@ exports.request = request; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 759: -/***/ (function(module) { - -"use strict"; - - -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/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; - - /***/ }), /***/ 761: @@ -7647,76 +4795,6 @@ module.exports.argument = escapeArgument; module.exports = require("zlib"); -/***/ }), - -/***/ 768: -/***/ (function(module) { - -"use strict"; - -module.exports = function (x) { - var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); - var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); - - if (x[x.length - 1] === lf) { - x = x.slice(0, x.length - 1); - } - - if (x[x.length - 1] === cr) { - x = x.slice(0, x.length - 1); - } - - return x; -}; - - -/***/ }), - -/***/ 774: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const cp = __webpack_require__(129); -const parse = __webpack_require__(884); -const enoent = __webpack_require__(15); - -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; - - /***/ }), /***/ 794: @@ -7727,27 +4805,23 @@ module.exports = require("stream"); /***/ }), /***/ 796: -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/***/ (function(__unusedmodule, exports) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var osName = _interopDefault(__webpack_require__(2)); - function getUserAgent() { - try { - return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`; - } catch (error) { - if (/wmic os get Caption/.test(error.message)) { - return "Windows "; - } + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; + } - return ""; + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } + + return ""; } exports.getUserAgent = getUserAgent; @@ -7811,55 +4885,6 @@ exports.createTokenAuth = createTokenAuth; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 818: -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(747) - -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT - - if (!pathext) { - return true - } - - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} - -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} - - /***/ }), /***/ 835: @@ -7887,11 +4912,13 @@ const Endpoints = { createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], + createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], @@ -8051,6 +5078,14 @@ const Endpoints = { suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"] }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], + getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], + getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] + }, checks: { create: ["POST /repos/{owner}/{repo}/check-runs", { mediaType: { @@ -8603,6 +5638,13 @@ const Endpoints = { previews: ["squirrel-girl"] } }], + deleteLegacy: ["DELETE /reactions/{reaction_id}", { + mediaType: { + previews: ["squirrel-girl"] + } + }, { + deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy" + }], listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] @@ -8752,7 +5794,11 @@ const Endpoints = { previews: ["zzzax"] } }], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile", { + mediaType: { + previews: ["black-panther"] + } + }], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], @@ -8871,7 +5917,11 @@ const Endpoints = { issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], - topics: ["GET /search/topics"], + topics: ["GET /search/topics", { + mediaType: { + previews: ["mercy"] + } + }], users: ["GET /search/users"] }, teams: { @@ -8954,7 +6004,7 @@ const Endpoints = { } }; -const VERSION = "4.0.0"; +const VERSION = "4.1.0"; function endpointsToMethods(octokit, endpointsMap) { const newMethods = {}; @@ -9057,188 +6107,29 @@ exports.restEndpointMethods = restEndpointMethods; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 862: -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } - - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; - } - - return ""; -} - -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - - /***/ }), /***/ 866: -/***/ (function(module) { - -module.exports = removeHook - -function removeHook (state, name, method) { - if (!state.registry[name]) { - return - } - - var index = state.registry[name] - .map(function (registered) { return registered.orig }) - .indexOf(method) - - if (index === -1) { - return - } - - state.registry[name].splice(index, 1) -} - - -/***/ }), - -/***/ 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__(607); - -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'; - } +/***/ (function(module) { - parsed.args = ['-c', shellCommand]; - } +module.exports = removeHook - return parsed; -} +function removeHook (state, name, method) { + if (!state.registry[name]) { + return + } -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } + var index = state.registry[name] + .map(function (registered) { return registered.orig }) + .indexOf(method) - 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, - }, - }; + if (index === -1) { + return + } - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); + state.registry[name].splice(index, 1) } -module.exports = parse; - /***/ }), @@ -9251,7 +6142,7 @@ module.exports = parse; Object.defineProperty(exports, '__esModule', { value: true }); var request = __webpack_require__(753); -var universalUserAgent = __webpack_require__(862); +var universalUserAgent = __webpack_require__(796); const VERSION = "4.5.2"; @@ -9333,33 +6224,6 @@ exports.withCustomRequest = withCustomRequest; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 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 : '') - ); -}; - - /***/ }), /***/ 921: @@ -9375,25 +6239,6 @@ const plugin_rest_endpoint_methods_1 = __webpack_require__(842); exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.restEndpointMethods); -/***/ }), - -/***/ 948: -/***/ (function(module) { - -"use strict"; - - -/** - * Tries to execute a function and discards any error that occurs. - * @param {Function} fn - Function that might or might not throw an error. - * @returns {?*} Return-value of the function when no error occurred. - */ -module.exports = function(fn) { - - try { return fn() } catch (e) {} - -} - /***/ }), /***/ 950: @@ -9460,483 +6305,6 @@ function checkBypass(reqUrl) { exports.checkBypass = checkBypass; -/***/ }), - -/***/ 955: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const path = __webpack_require__(622); -const childProcess = __webpack_require__(129); -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 pFinally = __webpack_require__(697); -const onExit = __webpack_require__(260); -const errname = __webpack_require__(427); -const stdio = __webpack_require__(168); - -const TEN_MEGABYTES = 1000 * 1000 * 10; - -function handleArgs(cmd, args, opts) { - let parsed; - - opts = Object.assign({ - extendEnv: true, - env: {} - }, opts); - - if (opts.extendEnv) { - opts.env = Object.assign({}, process.env, opts.env); - } - - if (opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args, - options: opts, - file: cmd, - original: { - cmd, - args - } - }; - } else { - parsed = crossSpawn._parse(cmd, args, opts); - } - - opts = Object.assign({ - maxBuffer: TEN_MEGABYTES, - buffer: true, - stripEof: true, - preferLocal: true, - localDir: parsed.options.cwd || process.cwd(), - encoding: 'utf8', - reject: true, - cleanup: true - }, parsed.options); - - opts.stdio = stdio(opts); - - if (opts.preferLocal) { - opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); - } - - if (opts.detached) { - // #115 - opts.cleanup = false; - } - - if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { - // #116 - parsed.args.unshift('/q'); - } - - return { - cmd: parsed.command, - args: parsed.args, - opts, - parsed - }; -} - -function handleInput(spawned, input) { - if (input === null || input === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -} - -function handleOutput(opts, val) { - if (val && opts.stripEof) { - val = stripEof(val); - } - - return val; -} - -function handleShell(fn, cmd, opts) { - let file = '/bin/sh'; - let args = ['-c', cmd]; - - opts = Object.assign({}, opts); - - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', `"${cmd}"`]; - opts.windowsVerbatimArguments = true; - } - - if (opts.shell) { - file = opts.shell; - delete opts.shell; - } - - return fn(file, args, opts); -} - -function getStream(process, stream, {encoding, buffer, maxBuffer}) { - if (!process[stream]) { - return null; - } - - let ret; - - if (!buffer) { - // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10 - ret = new Promise((resolve, reject) => { - process[stream] - .once('end', resolve) - .once('error', reject); - }); - } else if (encoding) { - ret = _getStream(process[stream], { - encoding, - maxBuffer - }); - } else { - ret = _getStream.buffer(process[stream], {maxBuffer}); - } - - return ret.catch(err => { - err.stream = stream; - err.message = `${stream} ${err.message}`; - throw err; - }); -} - -function makeError(result, options) { - const {stdout, stderr} = result; - - let err = result.error; - const {code, signal} = result; - - const {parsed, joinedCmd} = options; - const timedOut = options.timedOut || false; - - if (!err) { - let output = ''; - - if (Array.isArray(parsed.opts.stdio)) { - if (parsed.opts.stdio[2] !== 'inherit') { - output += output.length > 0 ? stderr : `\n${stderr}`; - } - - if (parsed.opts.stdio[1] !== 'inherit') { - output += `\n${stdout}`; - } - } else if (parsed.opts.stdio !== 'inherit') { - output = `\n${stderr}${stdout}`; - } - - err = new Error(`Command failed: ${joinedCmd}${output}`); - err.code = code < 0 ? errname(code) : code; - } - - err.stdout = stdout; - err.stderr = stderr; - err.failed = true; - err.signal = signal || null; - err.cmd = joinedCmd; - err.timedOut = timedOut; - - return err; -} - -function joinCmd(cmd, args) { - let joinedCmd = cmd; - - if (Array.isArray(args) && args.length > 0) { - joinedCmd += ' ' + args.join(' '); - } - - return joinedCmd; -} - -module.exports = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const {encoding, buffer, maxBuffer} = parsed.opts; - const joinedCmd = joinCmd(cmd, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - } catch (err) { - return Promise.reject(err); - } - - let removeExitHandler; - if (parsed.opts.cleanup) { - removeExitHandler = onExit(() => { - spawned.kill(); - }); - } - - let timeoutId = null; - let timedOut = false; - - const cleanup = () => { - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = null; - } - - if (removeExitHandler) { - removeExitHandler(); - } - }; - - if (parsed.opts.timeout > 0) { - timeoutId = setTimeout(() => { - timeoutId = null; - timedOut = true; - spawned.kill(parsed.opts.killSignal); - }, parsed.opts.timeout); - } - - const processDone = new Promise(resolve => { - spawned.on('exit', (code, signal) => { - cleanup(); - resolve({code, signal}); - }); - - spawned.on('error', err => { - cleanup(); - resolve({error: err}); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', err => { - cleanup(); - resolve({error: err}); - }); - } - }); - - function destroy() { - if (spawned.stdout) { - spawned.stdout.destroy(); - } - - if (spawned.stderr) { - spawned.stderr.destroy(); - } - } - - const handlePromise = () => pFinally(Promise.all([ - processDone, - getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}), - getStream(spawned, 'stderr', {encoding, buffer, maxBuffer}) - ]).then(arr => { - const result = arr[0]; - result.stdout = arr[1]; - result.stderr = arr[2]; - - if (result.error || result.code !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed, - timedOut - }); - - // TODO: missing some timeout logic for killed - // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 - // err.killed = spawned.killed || killed; - err.killed = err.killed || spawned.killed; - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - killed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; - }), destroy); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.opts.input); - - spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); - spawned.catch = onrejected => handlePromise().catch(onrejected); - - return spawned; -}; - -// TODO: set `stderr: 'ignore'` when that option is implemented -module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout); - -// TODO: set `stdout: 'ignore'` when that option is implemented -module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr); - -module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); - -module.exports.sync = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const joinedCmd = joinCmd(cmd, args); - - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } - - const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - result.code = result.status; - - if (result.error || result.status !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed - }); - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; -}; - -module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); - - -/***/ }), - -/***/ 966: -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const {PassThrough} = __webpack_require__(794); - -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: -/***/ (function(module, __unusedexports, __webpack_require__) { - -var wrappy = __webpack_require__(11) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} - - /***/ }) /******/ }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e706df453..8c610fb6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -923,16 +923,16 @@ } }, "@octokit/core": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.1.0.tgz", - "integrity": "sha512-yPyQSmxIXLieEIRikk2w8AEtWkFdfG/LXcw1KvEtK3iP0ENZLW/WYQmdzOKqfSaLhooz4CJ9D+WY79C8ZliACw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.1.1.tgz", + "integrity": "sha512-cQ2HGrtyNJ1IBxpTP1U5m/FkMAJvgw7d2j1q3c9P0XUuYilEgF6e4naTpsgm4iVcQeOnccZlw7XHRIUBy0ymcg==", "requires": { "@octokit/auth-token": "^2.4.0", "@octokit/graphql": "^4.3.1", "@octokit/request": "^5.4.0", "@octokit/types": "^5.0.0", "before-after-hook": "^2.1.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" } }, "@octokit/endpoint": { @@ -943,13 +943,6 @@ "@octokit/types": "^5.0.0", "is-plain-object": "^3.0.0", "universal-user-agent": "^6.0.0" - }, - "dependencies": { - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - } } }, "@octokit/graphql": { @@ -960,13 +953,6 @@ "@octokit/request": "^5.3.0", "@octokit/types": "^5.0.0", "universal-user-agent": "^6.0.0" - }, - "dependencies": { - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - } } }, "@octokit/plugin-paginate-rest": { @@ -978,11 +964,11 @@ } }, "@octokit/plugin-rest-endpoint-methods": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.0.0.tgz", - "integrity": "sha512-emS6gysz4E9BNi9IrCl7Pm4kR+Az3MmVB0/DoDCmF4U48NbYG3weKyDlgkrz6Jbl4Mu4nDx8YWZwC4HjoTdcCA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.1.0.tgz", + "integrity": "sha512-zbRTjm+xplSNlixotTVMvLJe8aRogUXS+r37wZK5EjLsNYH4j02K5XLMOWyYaSS4AJEZtPmzCcOcui4VzVGq+A==", "requires": { - "@octokit/types": "^5.0.0", + "@octokit/types": "^5.1.0", "deprecation": "^2.3.1" } }, @@ -999,13 +985,6 @@ "node-fetch": "^2.3.0", "once": "^1.4.0", "universal-user-agent": "^6.0.0" - }, - "dependencies": { - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - } } }, "@octokit/request-error": { @@ -1132,9 +1111,9 @@ } }, "@types/jest": { - "version": "26.0.4", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.4.tgz", - "integrity": "sha512-4fQNItvelbNA9+sFgU+fhJo8ZFF+AS4Egk3GWwCW2jFtViukXbnztccafAdLhzE/0EiCogljtQQXP8aQ9J7sFg==", + "version": "26.0.5", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.5.tgz", + "integrity": "sha512-heU+7w8snfwfjtcj2H458aTx3m5unIToOJhx75ebHilBiiQ39OIdA18WkG4LP08YKeAoWAGvWg8s+22w/PeJ6w==", "dev": true, "requires": { "jest-diff": "^25.2.1", @@ -2114,6 +2093,7 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -2227,9 +2207,9 @@ } }, "eslint": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.4.0.tgz", - "integrity": "sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.5.0.tgz", + "integrity": "sha512-vlUP10xse9sWt9SGRtcr1LAC67BENcQMFeV+w5EvLEoFe3xJ8cF1Skd0msziRx/VMC+72B4DxreCE+OR12OA6Q==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -2240,9 +2220,9 @@ "doctrine": "^3.0.0", "enquirer": "^2.3.5", "eslint-scope": "^5.1.0", - "eslint-utils": "^2.0.0", - "eslint-visitor-keys": "^1.2.0", - "espree": "^7.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -2256,7 +2236,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.14", + "lodash": "^4.17.19", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -2364,9 +2344,9 @@ } }, "eslint-plugin-github": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.0.1.tgz", - "integrity": "sha512-DkiME1DhBSd4ZarVKiF2qnlSg934UMiMFpo0FKHahSxeiCiAR1pd8Xfv/a64TDxs/mfLwuBZZXf/BM5UsWNyEg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.1.0.tgz", + "integrity": "sha512-SvNlnLV1X9VPu47i6WefLFjSmdpyHbx9pLjZxlQjqlZ6FkrWBfeo5T+NIQFzdwXxlE2BGGWa1z4nlJuJXCq2WQ==", "dev": true, "requires": { "@typescript-eslint/eslint-plugin": ">=2.25.0", @@ -2571,6 +2551,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, "requires": { "cross-spawn": "^6.0.0", "get-stream": "^4.0.0", @@ -2585,6 +2566,7 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -2596,17 +2578,20 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -2614,12 +2599,14 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -2995,6 +2982,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, "requires": { "pump": "^3.0.0" } @@ -3470,7 +3458,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-string": { "version": "1.0.5", @@ -3518,7 +3507,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -5032,11 +5022,6 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, - "macos-release": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.0.tgz", - "integrity": "sha512-ko6deozZYiAkqa/0gmcsz+p4jSy3gY7/ZsCEokPaYd8k+6/aXGkiTgr61+Owup7Sf+xjqW8u2ElhoM9SEcEfuA==" - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -5209,7 +5194,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "node-fetch": { "version": "2.6.0", @@ -5273,6 +5259,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, "requires": { "path-key": "^2.0.0" }, @@ -5280,7 +5267,8 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true } } }, @@ -5412,15 +5400,6 @@ "word-wrap": "^1.2.3" } }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - } - }, "p-each-series": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", @@ -5430,7 +5409,8 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true }, "p-limit": { "version": "1.3.0", @@ -5620,6 +5600,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -6087,7 +6068,8 @@ "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true }, "sisteransi": { "version": "1.0.5", @@ -6485,7 +6467,8 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true }, "strip-final-newline": { "version": "2.0.0", @@ -6649,9 +6632,9 @@ } }, "ts-jest": { - "version": "26.1.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.1.2.tgz", - "integrity": "sha512-V4SyBDO9gOdEh+AF4KtXJeP+EeI4PkOrxcA8ptl4o8nCXUVM5Gg/8ngGKneS5BsZaR9DXVQNqj9k+iqGAnpGow==", + "version": "26.1.3", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.1.3.tgz", + "integrity": "sha512-beUTSvuqR9SmKQEylewqJdnXWMVGJRFqSz2M8wKJe7GBMmLZ5zw6XXKSJckbHNMxn+zdB3guN2eOucSw2gBMnw==", "dev": true, "requires": { "bs-logger": "0.x", @@ -6761,9 +6744,9 @@ } }, "typescript": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", - "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, "union-value": { @@ -6779,12 +6762,9 @@ } }, "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, "unset-value": { "version": "1.0.0", @@ -6982,14 +6962,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "windows-release": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.1.tgz", - "integrity": "sha512-Pngk/RDCaI/DkuHPlGTdIkDiTAnAkyMjoQMZqRsxydNl1qGXNIoZrB7RK8g53F2tEgQBMqQJHQdYZuQEEAu54A==", - "requires": { - "execa": "^1.0.0" - } - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 86a7cd684..f11f69c48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slash-command-dispatch", - "version": "1.0.0", + "version": "2.0.0", "private": true, "description": "Create repository dispatch events for slash commands", "main": "lib/main.js", @@ -29,23 +29,23 @@ "dependencies": { "@actions/core": "1.2.4", "@actions/github": "4.0.0", - "@octokit/core": "3.1.0", + "@octokit/core": "3.1.1", "@octokit/plugin-paginate-rest": "2.2.3", - "@octokit/plugin-rest-endpoint-methods": "4.0.0" + "@octokit/plugin-rest-endpoint-methods": "4.1.0" }, "devDependencies": { - "@types/jest": "26.0.4", + "@types/jest": "26.0.5", "@types/node": "14.0.23", "@typescript-eslint/parser": "3.6.1", "@zeit/ncc": "0.22.3", - "eslint": "7.4.0", - "eslint-plugin-github": "4.0.1", + "eslint": "7.5.0", + "eslint-plugin-github": "4.1.0", "eslint-plugin-jest": "23.18.0", "jest": "26.1.0", "jest-circus": "26.1.0", "js-yaml": "3.14.0", "prettier": "2.0.5", - "ts-jest": "26.1.2", - "typescript": "3.9.6" + "ts-jest": "26.1.3", + "typescript": "3.9.7" } } From 0849c83c5c10c4c9e4c6e3ebfb10b50b5c48132e Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 21 Jul 2020 14:43:17 +0900 Subject: [PATCH 04/33] Refactor slash_command context and remove named-args input --- .github/slash-command-dispatch.json | 3 +- .github/workflows/ping-command.yml | 2 +- README.md | 55 ++++++++++----------- __test__/command-helper.test.ts | 76 +++++++++++++++-------------- action.yml | 3 -- dist/index.js | 35 +++++++------ docs/advanced-configuration.md | 4 +- docs/examples.md | 10 ++-- src/command-helper.ts | 48 ++++++++++-------- src/main.ts | 5 +- 10 files changed, 120 insertions(+), 121 deletions(-) diff --git a/.github/slash-command-dispatch.json b/.github/slash-command-dispatch.json index a419b1cdf..cc18ef604 100644 --- a/.github/slash-command-dispatch.json +++ b/.github/slash-command-dispatch.json @@ -3,8 +3,7 @@ "command": "create", "permission": "write", "issue_type": "issue", - "event_type_suffix": "-cmd", - "named_args": true + "event_type_suffix": "-cmd" }, { "command": "delete", diff --git a/.github/workflows/ping-command.yml b/.github/workflows/ping-command.yml index d7cebb3ac..671ef24d1 100644 --- a/.github/workflows/ping-command.yml +++ b/.github/workflows/ping-command.yml @@ -11,5 +11,5 @@ jobs: with: comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - >pong ${{ github.event.client_payload.slash_command.args }} + >pong ${{ github.event.client_payload.slash_command.args.all }} reaction-type: hooray diff --git a/README.md b/README.md index 59183f64b..1991ff25a 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,6 @@ This action also features [advanced configuration](docs/advanced-configuration.m | `allow-edits` | Allow edited comments to trigger command dispatches. | `false` | | `repository` | The full name of the repository to send the dispatch events. | Current repository | | `event-type-suffix` | The repository dispatch event type suffix for the commands. | `-command` | -| `named-args` | Parse named arguments and add them to the command payload. | `false` | | `config` | | JSON configuration for commands. See [Advanced configuration](docs/advanced-configuration.md) | | | `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](docs/advanced-configuration.md) | | @@ -128,47 +127,43 @@ Commands are dispatched with a payload containing a number of contexts. #### `slash_command` context -The slash command context can be accessed as follows. -`args` is a space separated string of all the supplied arguments. -Each argument is also supplied in a numbered property, i.e. `arg1`, `arg2`, `arg3`, etc. +The slash command context contains the command and any arguments supplied with it. -```yml - - name: Output command and arguments - run: | - echo ${{ github.event.client_payload.slash_command.command }} - echo ${{ github.event.client_payload.slash_command.args }} - echo ${{ github.event.client_payload.slash_command.arg1 }} - echo ${{ github.event.client_payload.slash_command.arg2 }} - echo ${{ github.event.client_payload.slash_command.arg3 }} - # etc. -``` - -If the `named-args` input is set to `true`, any arguments that are prefixed in the format `name=argument` will be parsed and added to the payload. - -For example, the slash command `/deploy branch=master env=prod some other args` will be set in the JSON payload as follows. +For example, the slash command `/deploy branch=master env=prod some other args` will be converted to a JSON payload as follows. ```json "slash_command": { "command": "deploy", - "args": "branch=master env=prod some other args", - "unnamed_args": "some other args", - "branch": "master", - "env": "prod", - "arg1": "some", - "arg2": "other", - "arg3": "args" + "args": { + "all": "branch=master env=prod some other args", + "unnamed": { + "all": "some other args", + "arg1": "some", + "arg2": "other", + "arg3": "args" + }, + "named": { + "branch": "master", + "env": "prod" + }, + } } ``` -These named arguments can be accessed in a workflow as follows. +The properties in the `slash_command` context from the above example can be used in a workflow as follows. ```yml - - name: Output command and named arguments + - name: Output command and arguments run: | echo ${{ github.event.client_payload.slash_command.command }} - echo ${{ github.event.client_payload.slash_command.branch }} - echo ${{ github.event.client_payload.slash_command.env }} - echo ${{ github.event.client_payload.slash_command.unnamed_args }} + echo ${{ github.event.client_payload.slash_command.args.all }} + echo ${{ github.event.client_payload.slash_command.args.unnamed.all }} + echo ${{ github.event.client_payload.slash_command.args.unnamed.arg1 }} + echo ${{ github.event.client_payload.slash_command.args.unnamed.arg2 }} + echo ${{ github.event.client_payload.slash_command.args.unnamed.arg3 }} + echo ${{ github.event.client_payload.slash_command.args.named.branch }} + echo ${{ github.event.client_payload.slash_command.args.named.env }} + # etc. ``` #### `github` and `pull_request` contexts diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index 4b7f295ee..b2c6404e7 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -23,7 +23,6 @@ describe('command-helper tests', () => { // Should be the value of github.repository, but '' for tests repository: '', eventTypeSuffix: '-command', - namedArgs: false, config: '', configFromFile: '' } @@ -39,7 +38,6 @@ describe('command-helper tests', () => { expect(config[i].event_type_suffix).toEqual( commandDefaults.event_type_suffix ) - expect(config[i].named_args).toEqual(commandDefaults.named_args) } }) @@ -54,7 +52,6 @@ describe('command-helper tests', () => { allowEdits: true, repository: 'owner/repo', eventTypeSuffix: '-cmd', - namedArgs: true, config: '', configFromFile: '' } @@ -68,7 +65,6 @@ describe('command-helper tests', () => { expect(config[i].allow_edits).toEqual(inputs.allowEdits) expect(config[i].repository).toEqual(inputs.repository) expect(config[i].event_type_suffix).toEqual(inputs.eventTypeSuffix) - expect(config[i].named_args).toEqual(inputs.namedArgs) } }) @@ -93,7 +89,6 @@ describe('command-helper tests', () => { expect(config[i].event_type_suffix).toEqual( commandDefaults.event_type_suffix ) - expect(config[i].named_args).toEqual(commandDefaults.named_args) } }) @@ -105,8 +100,7 @@ describe('command-helper tests', () => { "issue_type": "pull-request", "allow_edits": true, "repository": "owner/repo", - "event_type_suffix": "-cmd", - "named_args": true + "event_type_suffix": "-cmd" }, { "command": "test-all-the-things", @@ -122,7 +116,6 @@ describe('command-helper tests', () => { expect(config[0].allow_edits).toBeTruthy() expect(config[0].repository).toEqual('owner/repo') expect(config[0].event_type_suffix).toEqual('-cmd') - expect(config[0].named_args).toBeTruthy() expect(config[1].command).toEqual(commands[1]) expect(config[1].permission).toEqual('read') expect(config[1].issue_type).toEqual(commandDefaults.issue_type) @@ -136,8 +129,7 @@ describe('command-helper tests', () => { issue_type: 'both', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command', - named_args: false + event_type_suffix: '-command' } ] expect(configIsValid(config)).toBeTruthy() @@ -151,8 +143,7 @@ describe('command-helper tests', () => { issue_type: 'both', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command', - named_args: false + event_type_suffix: '-command' } ] expect(configIsValid(config)).toBeFalsy() @@ -166,8 +157,7 @@ describe('command-helper tests', () => { issue_type: 'test-case-invalid-issue-type', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command', - named_args: false + event_type_suffix: '-command' } ] expect(configIsValid(config)).toBeFalsy() @@ -188,44 +178,58 @@ describe('command-helper tests', () => { test('slash command payload', async () => { const commandWords = ['test', 'arg1', 'arg2', 'arg3'] - const namedArgs = false const payload: SlashCommandPayload = { command: 'test', - args: 'arg1 arg2 arg3', - arg1: 'arg1', - arg2: 'arg2', - arg3: 'arg3' + args: { + all: 'arg1 arg2 arg3', + unnamed: { + all: 'arg1 arg2 arg3', + arg1: 'arg1', + arg2: 'arg2', + arg3: 'arg3' + }, + named: {} + } } - expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandWords)).toEqual(payload) }) test('slash command payload with named args', async () => { const commandWords = ['test', 'branch=master', 'arg1', 'env=prod', 'arg2'] - const namedArgs = true const payload: SlashCommandPayload = { command: 'test', - args: 'branch=master arg1 env=prod arg2', - unnamed_args: 'arg1 arg2', - branch: 'master', - env: 'prod', - arg1: 'arg1', - arg2: 'arg2' + args: { + all: 'branch=master arg1 env=prod arg2', + unnamed: { + all: 'arg1 arg2', + arg1: 'arg1', + arg2: 'arg2' + }, + named: { + branch: 'master', + env: 'prod' + } + } } - expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandWords)).toEqual(payload) }) test('slash command payload with malformed named args', async () => { const commandWords = ['test', 'branch=', 'arg1', 'e-nv=prod', 'arg2'] - const namedArgs = true const payload: SlashCommandPayload = { command: 'test', - args: 'branch= arg1 e-nv=prod arg2', - unnamed_args: 'branch= arg1 e-nv=prod arg2', - arg1: 'branch=', - arg2: 'arg1', - arg3: 'e-nv=prod', - arg4: 'arg2' + args: { + all: 'branch= arg1 e-nv=prod arg2', + unnamed: { + all: 'branch= arg1 e-nv=prod arg2', + arg1: 'branch=', + arg2: 'arg1', + arg3: 'e-nv=prod', + arg4: 'arg2' + }, + named: {} + } } - expect(getSlashCommandPayload(commandWords, namedArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandWords)).toEqual(payload) }) }) diff --git a/action.yml b/action.yml index 9d741e3fe..850fcb754 100644 --- a/action.yml +++ b/action.yml @@ -28,9 +28,6 @@ inputs: event-type-suffix: description: 'The repository dispatch event type suffix for the commands.' default: -command - named-args: - description: 'Parse named arguments and add them to the command payload.' - default: false config: description: 'JSON configuration for commands.' config-from-file: diff --git a/dist/index.js b/dist/index.js index f305f10aa..7ff7c3602 100644 --- a/dist/index.js +++ b/dist/index.js @@ -636,7 +636,7 @@ function run() { // Dispatch for each matching configuration for (const cmd of configMatches) { // Generate slash command payload - clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords, cmd.named_args); + clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords); core.debug(`Slash command payload: ${util_1.inspect(clientPayload.slash_command)}`); // Dispatch the command const dispatchRepo = cmd.repository.split('/'); @@ -954,8 +954,7 @@ exports.commandDefaults = Object.freeze({ issue_type: 'both', allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', - event_type_suffix: '-command', - named_args: false + event_type_suffix: '-command' }); function toBool(input, defaultVal) { if (typeof input === 'boolean') { @@ -981,7 +980,6 @@ function getInputs() { allowEdits: core.getInput('allow-edits') === 'true', repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), - namedArgs: core.getInput('named-args') === 'true', config: core.getInput('config'), configFromFile: core.getInput('config-from-file') }; @@ -1018,8 +1016,7 @@ function getCommandsConfigFromInputs(inputs) { issue_type: inputs.issueType, allow_edits: inputs.allowEdits, repository: inputs.repository, - event_type_suffix: inputs.eventTypeSuffix, - named_args: inputs.namedArgs + event_type_suffix: inputs.eventTypeSuffix }; config.push(cmd); } @@ -1039,8 +1036,7 @@ function getCommandsConfigFromJson(json) { repository: jc.repository ? jc.repository : exports.commandDefaults.repository, event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix - : exports.commandDefaults.event_type_suffix, - named_args: toBool(jc.named_args, exports.commandDefaults.named_args) + : exports.commandDefaults.event_type_suffix }; config.push(cmd); } @@ -1092,33 +1088,40 @@ function addReaction(octokit, repo, commentId, reaction) { }); } exports.addReaction = addReaction; -function getSlashCommandPayload(commandWords, namedArgs) { +function getSlashCommandPayload(commandWords) { const payload = { command: commandWords[0], - args: '' + args: { + all: '', + unnamed: { + all: '' + }, + named: {} + } }; if (commandWords.length > 1) { const argWords = commandWords.slice(1, exports.MAX_ARGS + 1); - payload.args = argWords.join(' '); + payload.args.all = argWords.join(' '); // Parse named and unnamed args let unnamedCount = 1; const unnamedArgs = []; for (const argWord of argWords) { - if (namedArgs && NAMED_ARG_PATTERN.test(argWord)) { + if (NAMED_ARG_PATTERN.test(argWord)) { const result = NAMED_ARG_PATTERN.exec(argWord); if (result && result.groups) { - payload[`${result.groups['name']}`] = result.groups['value']; + payload.args.named[`${result.groups['name']}`] = + result.groups['value']; } } else { unnamedArgs.push(argWord); - payload[`arg${unnamedCount}`] = argWord; + payload.args.unnamed[`arg${unnamedCount}`] = argWord; unnamedCount += 1; } } // Add a string of only the unnamed args - if (namedArgs && unnamedArgs.length > 0) { - payload['unnamed_args'] = unnamedArgs.join(' '); + if (unnamedArgs.length > 0) { + payload.args.unnamed.all = unnamedArgs.join(' '); } } return payload; diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index 666344a6e..8dab79997 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -50,8 +50,7 @@ jobs: "command": "integration-test", "permission": "write", "issue_type": "both", - "repository": "peter-evans/slash-command-dispatch-processor", - "named_args": true + "repository": "peter-evans/slash-command-dispatch-processor" }, { "command": "create-ticket", @@ -98,6 +97,5 @@ Advanced configuration requires a combination of yaml based inputs and JSON conf | | `allow_edits` | Allow edited comments to trigger command dispatches. | `false` | | | `repository` | The full name of the repository to send the dispatch events. | Current repository | | | `event_type_suffix` | The repository dispatch event type suffix for the command. | `-command` | -| | `named_args` | Parse named arguments and add them to the command payload. | `false` | | `config` | | JSON configuration for commands. | | | `config-from-file` | | JSON configuration from a file for commands. | | diff --git a/docs/examples.md b/docs/examples.md index b38ce800e..f05a76533 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -15,8 +15,6 @@ This is pattern for a slash command where a named argument specifies the branch /do-something branch=develop ``` -In the dispatch configuration for this command pattern, `named-args` should be set to `true`. - In the following command workflow, `REPO_ACCESS_TOKEN` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). ```yml @@ -32,7 +30,7 @@ jobs: - name: Get the target branch name id: vars run: | - branch=${{ github.event.client_payload.slash_command.branch }} + branch=${{ github.event.client_payload.slash_command.args.named.branch }} if [[ -z "$branch" ]]; then branch="master"; fi echo ::set-output name=branch::$branch @@ -68,7 +66,7 @@ This is a real example that uses this pattern to execute the Python test tool [p /pytest branch=develop -v -s ``` -In the following command workflow, note how the remaining `unnamed_args` are passed to the `pytest` tool. +In the following command workflow, note how the unnamed arguments are passed to the `pytest` tool with the property `args.unnamed.all`. ```yml name: pytest @@ -83,7 +81,7 @@ jobs: - name: Get the target branch name id: vars run: | - branch=${{ github.event.client_payload.slash_command.branch }} + branch=${{ github.event.client_payload.slash_command.args.named.branch }} if [[ -z "$branch" ]]; then branch="master"; fi echo ::set-output name=branch::$branch @@ -109,7 +107,7 @@ jobs: # Execute pytest - name: Execute pytest - run: pytest ${{ github.event.client_payload.slash_command.unnamed_args }} + run: pytest ${{ github.event.client_payload.slash_command.args.unnamed.all }} # Add reaction to the comment - name: Add reaction diff --git a/src/command-helper.ts b/src/command-helper.ts index 7fd560a20..e1a86e7d3 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -17,7 +17,6 @@ export interface Inputs { allowEdits: boolean repository: string eventTypeSuffix: string - namedArgs: boolean config: string configFromFile: string } @@ -29,7 +28,6 @@ export interface Command { allow_edits: boolean repository: string event_type_suffix: string - named_args: boolean } interface Repo { @@ -39,8 +37,16 @@ interface Repo { export interface SlashCommandPayload { command: string - args: string - [k: string]: string + args: { + all: string + unnamed: { + all: string + [k: string]: string + } + named: { + [k: string]: string + } + } } export const commandDefaults = Object.freeze({ @@ -48,8 +54,7 @@ export const commandDefaults = Object.freeze({ issue_type: 'both', allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', - event_type_suffix: '-command', - named_args: false + event_type_suffix: '-command' }) export function toBool(input: string, defaultVal: boolean): boolean { @@ -74,7 +79,6 @@ export function getInputs(): Inputs { allowEdits: core.getInput('allow-edits') === 'true', repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), - namedArgs: core.getInput('named-args') === 'true', config: core.getInput('config'), configFromFile: core.getInput('config-from-file') } @@ -110,8 +114,7 @@ export function getCommandsConfigFromInputs(inputs: Inputs): Command[] { issue_type: inputs.issueType, allow_edits: inputs.allowEdits, repository: inputs.repository, - event_type_suffix: inputs.eventTypeSuffix, - named_args: inputs.namedArgs + event_type_suffix: inputs.eventTypeSuffix } config.push(cmd) } @@ -132,8 +135,7 @@ export function getCommandsConfigFromJson(json: string): Command[] { repository: jc.repository ? jc.repository : commandDefaults.repository, event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix - : commandDefaults.event_type_suffix, - named_args: toBool(jc.named_args, commandDefaults.named_args) + : commandDefaults.event_type_suffix } config.push(cmd) } @@ -212,34 +214,40 @@ export async function addReaction( } export function getSlashCommandPayload( - commandWords: string[], - namedArgs: boolean + commandWords: string[] ): SlashCommandPayload { const payload: SlashCommandPayload = { command: commandWords[0], - args: '' + args: { + all: '', + unnamed: { + all: '' + }, + named: {} + } } if (commandWords.length > 1) { const argWords = commandWords.slice(1, MAX_ARGS + 1) - payload.args = argWords.join(' ') + payload.args.all = argWords.join(' ') // Parse named and unnamed args let unnamedCount = 1 const unnamedArgs: string[] = [] for (const argWord of argWords) { - if (namedArgs && NAMED_ARG_PATTERN.test(argWord)) { + if (NAMED_ARG_PATTERN.test(argWord)) { const result = NAMED_ARG_PATTERN.exec(argWord) if (result && result.groups) { - payload[`${result.groups['name']}`] = result.groups['value'] + payload.args.named[`${result.groups['name']}`] = + result.groups['value'] } } else { unnamedArgs.push(argWord) - payload[`arg${unnamedCount}`] = argWord + payload.args.unnamed[`arg${unnamedCount}`] = argWord unnamedCount += 1 } } // Add a string of only the unnamed args - if (namedArgs && unnamedArgs.length > 0) { - payload['unnamed_args'] = unnamedArgs.join(' ') + if (unnamedArgs.length > 0) { + payload.args.unnamed.all = unnamedArgs.join(' ') } } return payload diff --git a/src/main.ts b/src/main.ts index 743abcb45..35abb9aad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -170,10 +170,7 @@ async function run(): Promise { // Dispatch for each matching configuration for (const cmd of configMatches) { // Generate slash command payload - clientPayload.slash_command = getSlashCommandPayload( - commandWords, - cmd.named_args - ) + clientPayload.slash_command = getSlashCommandPayload(commandWords) core.debug( `Slash command payload: ${inspect(clientPayload.slash_command)}` ) From 50fbe8b1e337838cd5814f0b666f9f397a1f8395 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 21 Jul 2020 15:57:37 +0900 Subject: [PATCH 05/33] Allow commands input to be newline separated --- .github/workflows/slash-command-dispatch.yml | 4 +- README.md | 12 +++-- __test__/command-helper.test.ts | 8 +-- action.yml | 2 +- dist/index.js | 51 ++++++++++++++++++-- docs/advanced-configuration.md | 5 +- docs/updating.md | 9 +++- src/command-helper.ts | 11 ++--- src/utils.ts | 15 ++++++ 9 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 src/utils.ts diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index b763334ae..c20da30d1 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -18,7 +18,9 @@ jobs: uses: ./ with: token: ${{ secrets.REPO_ACCESS_TOKEN }} - commands: hello-world-local, ping-local + commands: | + hello-world-local + ping-local permission: none issue-type: issue diff --git a/README.md b/README.md index 1991ff25a..3c16e6b26 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,10 @@ jobs: uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} - commands: deploy, integration-test, build-docs + commands: | + deploy + integration-test + build-docs ``` Note that not specifying the `repository` input will mean that `repository_dispatch` events are created in the *current* repository by default. It's perfectly fine to use the current repository and not dispatch events to a seperate "processor" repository. @@ -67,7 +70,7 @@ This action also features [advanced configuration](docs/advanced-configuration.m | `token` | (**required**) A `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](#token) for further details. | | | `reaction-token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](#reaction-token) for further details. | `GITHUB_TOKEN` | | `reactions` | Add reactions. :eyes: = seen, :rocket: = dispatched | `true` | -| `commands` | (**required**) A comma separated list of commands. | | +| `commands` | (**required**) A comma or newline separated list of commands. | | | `permission` | The repository permission level required by the user to dispatch commands. (`none`, `read`, `write`, `admin`) | `write` | | `issue-type` | The issue type required for commands. (`issue`, `pull-request`, `both`) | `both` | | `allow-edits` | Allow edited comments to trigger command dispatches. | `false` | @@ -94,7 +97,10 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c with: token: ${{ secrets.REPO_ACCESS_TOKEN }} reaction-token: ${{ secrets.REPO_ACCESS_TOKEN }} - commands: deploy, integration-test, build-docs + commands: | + deploy + integration-test + build-docs ``` ### How comments are parsed for slash commands diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index b2c6404e7..ac3457b41 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -12,11 +12,12 @@ import { describe('command-helper tests', () => { test('building config with required inputs only', async () => { + const commands = ['list', 'of', 'slash', 'commands'] const inputs: Inputs = { token: '', reactionToken: '', reactions: true, - commands: 'list, of, slash, commands', + commands: commands, permission: 'write', issueType: 'both', allowEdits: false, @@ -26,7 +27,6 @@ describe('command-helper tests', () => { config: '', configFromFile: '' } - const commands = inputs.commands.replace(/\s+/g, '').split(',') const config = getCommandsConfigFromInputs(inputs) expect(config.length).toEqual(4) for (var i = 0; i < config.length; i++) { @@ -42,11 +42,12 @@ describe('command-helper tests', () => { }) test('building config with optional inputs', async () => { + const commands = ['list', 'of', 'slash', 'commands'] const inputs: Inputs = { token: '', reactionToken: '', reactions: true, - commands: 'list, of, slash, commands', + commands: commands, permission: 'admin', issueType: 'pull-request', allowEdits: true, @@ -55,7 +56,6 @@ describe('command-helper tests', () => { config: '', configFromFile: '' } - const commands = inputs.commands.replace(/\s+/g, '').split(',') const config = getCommandsConfigFromInputs(inputs) expect(config.length).toEqual(4) for (var i = 0; i < config.length; i++) { diff --git a/action.yml b/action.yml index 850fcb754..109df914c 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: description: 'Add reactions to comments containing commands.' default: true commands: - description: 'A comma separated list of commands.' + description: 'A comma or newline separated list of commands.' required: true permission: description: 'The repository permission level required by the user to dispatch commands.' diff --git a/dist/index.js b/dist/index.js index 7ff7c3602..4974ff845 100644 --- a/dist/index.js +++ b/dist/index.js @@ -947,6 +947,7 @@ exports.getSlashCommandPayload = exports.addReaction = exports.getActorPermissio const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const util_1 = __webpack_require__(669); +const utils = __importStar(__webpack_require__(611)); const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/; exports.MAX_ARGS = 50; exports.commandDefaults = Object.freeze({ @@ -974,7 +975,7 @@ function getInputs() { token: core.getInput('token'), reactionToken: core.getInput('reaction-token'), reactions: core.getInput('reactions') === 'true', - commands: core.getInput('commands'), + commands: utils.getInputAsArray('commands'), permission: core.getInput('permission'), issueType: core.getInput('issue-type'), allowEdits: core.getInput('allow-edits') === 'true', @@ -1004,12 +1005,10 @@ function getCommandsConfig(inputs) { } exports.getCommandsConfig = getCommandsConfig; function getCommandsConfigFromInputs(inputs) { - // Get commands - const commands = inputs.commands.replace(/\s+/g, '').split(','); - core.debug(`Commands: ${util_1.inspect(commands)}`); + core.debug(`Commands: ${util_1.inspect(inputs.commands)}`); // Build config const config = []; - for (const c of commands) { + for (const c of inputs.commands) { const cmd = { command: c, permission: inputs.permission, @@ -4516,6 +4515,48 @@ exports.HttpClient = HttpClient; module.exports = require("http"); +/***/ }), + +/***/ 611: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStringAsArray = exports.getInputAsArray = void 0; +const core = __importStar(__webpack_require__(470)); +function getInputAsArray(name, options) { + return getStringAsArray(core.getInput(name, options)); +} +exports.getInputAsArray = getInputAsArray; +function getStringAsArray(str) { + return str + .split(/[\n,]+/) + .map(s => s.trim()) + .filter(x => x !== ''); +} +exports.getStringAsArray = getStringAsArray; + + /***/ }), /***/ 614: diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index 8dab79997..a6560c9c8 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -11,7 +11,10 @@ For example, the following basic configuration means that all commands must have uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} - commands: deploy, integration-test, build-docs + commands: | + deploy + integration-test + build-docs permission: admin ``` diff --git a/docs/updating.md b/docs/updating.md index 80a559af0..ad58be5b9 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -6,4 +6,11 @@ ### New features -- +- The `commands` input can now be newline separated, or comma separated. + e.g. + ```yml + commands: | + deploy + integration-test + build-docs + ``` diff --git a/src/command-helper.ts b/src/command-helper.ts index e1a86e7d3..c4d0689ef 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -2,6 +2,7 @@ import * as core from '@actions/core' import * as fs from 'fs' import {inspect} from 'util' import {Octokit} from './octokit-client' +import * as utils from './utils' const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/ @@ -11,7 +12,7 @@ export interface Inputs { token: string reactionToken: string reactions: boolean - commands: string + commands: string[] permission: string issueType: string allowEdits: boolean @@ -73,7 +74,7 @@ export function getInputs(): Inputs { token: core.getInput('token'), reactionToken: core.getInput('reaction-token'), reactions: core.getInput('reactions') === 'true', - commands: core.getInput('commands'), + commands: utils.getInputAsArray('commands'), permission: core.getInput('permission'), issueType: core.getInput('issue-type'), allowEdits: core.getInput('allow-edits') === 'true', @@ -101,13 +102,11 @@ export function getCommandsConfig(inputs: Inputs): Command[] { } export function getCommandsConfigFromInputs(inputs: Inputs): Command[] { - // Get commands - const commands = inputs.commands.replace(/\s+/g, '').split(',') - core.debug(`Commands: ${inspect(commands)}`) + core.debug(`Commands: ${inspect(inputs.commands)}`) // Build config const config: Command[] = [] - for (const c of commands) { + for (const c of inputs.commands) { const cmd: Command = { command: c, permission: inputs.permission, diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 000000000..59b21e7e9 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,15 @@ +import * as core from '@actions/core' + +export function getInputAsArray( + name: string, + options?: core.InputOptions +): string[] { + return getStringAsArray(core.getInput(name, options)) +} + +export function getStringAsArray(str: string): string[] { + return str + .split(/[\n,]+/) + .map(s => s.trim()) + .filter(x => x !== '') +} From 77db62f2437ee5036e61e8dd0ac9d6e32f71d30f Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 21 Jul 2020 18:30:18 +0900 Subject: [PATCH 06/33] Add static arguments --- .github/slash-command-dispatch.json | 6 +++- README.md | 36 ++++++++++++++------ __test__/command-helper.test.ts | 52 +++++++++++++++++++++++++---- action.yml | 2 ++ dist/index.js | 21 ++++++++---- docs/advanced-configuration.md | 7 +++- docs/updating.md | 17 ++++++++++ src/command-helper.ts | 23 +++++++++---- src/main.ts | 5 ++- 9 files changed, 136 insertions(+), 33 deletions(-) diff --git a/.github/slash-command-dispatch.json b/.github/slash-command-dispatch.json index cc18ef604..33cfede19 100644 --- a/.github/slash-command-dispatch.json +++ b/.github/slash-command-dispatch.json @@ -9,7 +9,11 @@ "command": "delete", "permission": "write", "issue_type": "both", - "allow_edits": true + "allow_edits": true, + "static_args": [ + "some-unnamed-arg", + "foo=bar" + ] }, { "command": "do-something-remotely", diff --git a/README.md b/README.md index 3c16e6b26..802ff3b41 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ This action also features [advanced configuration](docs/advanced-configuration.m | `allow-edits` | Allow edited comments to trigger command dispatches. | `false` | | `repository` | The full name of the repository to send the dispatch events. | Current repository | | `event-type-suffix` | The repository dispatch event type suffix for the commands. | `-command` | +| `static-args` | A comma or newline separated list of arguments that will be dispatched with every command. | | | `config` | | JSON configuration for commands. See [Advanced configuration](docs/advanced-configuration.md) | | | `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](docs/advanced-configuration.md) | | @@ -133,24 +134,38 @@ Commands are dispatched with a payload containing a number of contexts. #### `slash_command` context -The slash command context contains the command and any arguments supplied with it. +The slash command context contains the command and any arguments that were supplied by the user. +It will also contain any static arguments, if configured. -For example, the slash command `/deploy branch=master env=prod some other args` will be converted to a JSON payload as follows. +To demonstrate, take the following configuration as an example. +```yml + - uses: peter-evans/slash-command-dispatch@v2 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + commands: | + deploy + static-args: | + production + region=us-east-1 +``` + +For the above example configuration, the slash command `/deploy branch=master some other args` will be converted to a JSON payload as follows. ```json "slash_command": { "command": "deploy", "args": { - "all": "branch=master env=prod some other args", + "all": "production region=us-east-1 branch=master some other args", "unnamed": { - "all": "some other args", - "arg1": "some", - "arg2": "other", - "arg3": "args" + "all": "production some other args", + "arg1": "production", + "arg2": "some", + "arg3": "other", + "arg4": "args" }, "named": { - "branch": "master", - "env": "prod" + "region": "us-east-1", + "branch": "master" }, } } @@ -167,8 +182,9 @@ The properties in the `slash_command` context from the above example can be used echo ${{ github.event.client_payload.slash_command.args.unnamed.arg1 }} echo ${{ github.event.client_payload.slash_command.args.unnamed.arg2 }} echo ${{ github.event.client_payload.slash_command.args.unnamed.arg3 }} + echo ${{ github.event.client_payload.slash_command.args.unnamed.arg4 }} + echo ${{ github.event.client_payload.slash_command.args.named.region }} echo ${{ github.event.client_payload.slash_command.args.named.branch }} - echo ${{ github.event.client_payload.slash_command.args.named.env }} # etc. ``` diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index ac3457b41..e09f79aa7 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -24,6 +24,7 @@ describe('command-helper tests', () => { // Should be the value of github.repository, but '' for tests repository: '', eventTypeSuffix: '-command', + staticArgs: [], config: '', configFromFile: '' } @@ -38,6 +39,7 @@ describe('command-helper tests', () => { expect(config[i].event_type_suffix).toEqual( commandDefaults.event_type_suffix ) + expect(config[i].static_args).toEqual(commandDefaults.static_args) } }) @@ -53,6 +55,7 @@ describe('command-helper tests', () => { allowEdits: true, repository: 'owner/repo', eventTypeSuffix: '-cmd', + staticArgs: ['production', 'region=us-east-1'], config: '', configFromFile: '' } @@ -65,6 +68,7 @@ describe('command-helper tests', () => { expect(config[i].allow_edits).toEqual(inputs.allowEdits) expect(config[i].repository).toEqual(inputs.repository) expect(config[i].event_type_suffix).toEqual(inputs.eventTypeSuffix) + expect(config[i].static_args).toEqual(inputs.staticArgs) } }) @@ -89,6 +93,7 @@ describe('command-helper tests', () => { expect(config[i].event_type_suffix).toEqual( commandDefaults.event_type_suffix ) + expect(config[i].static_args).toEqual(commandDefaults.static_args) } }) @@ -104,7 +109,11 @@ describe('command-helper tests', () => { }, { "command": "test-all-the-things", - "permission": "read" + "permission": "read", + "static_args": [ + "production", + "region=us-east-1" + ] } ]` const commands = ['do-stuff', 'test-all-the-things'] @@ -119,6 +128,7 @@ describe('command-helper tests', () => { expect(config[1].command).toEqual(commands[1]) expect(config[1].permission).toEqual('read') expect(config[1].issue_type).toEqual(commandDefaults.issue_type) + expect(config[1].static_args).toEqual(['production', 'region=us-east-1']) }) test('valid config', async () => { @@ -129,7 +139,8 @@ describe('command-helper tests', () => { issue_type: 'both', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command' + event_type_suffix: '-command', + static_args: [] } ] expect(configIsValid(config)).toBeTruthy() @@ -143,7 +154,8 @@ describe('command-helper tests', () => { issue_type: 'both', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command' + event_type_suffix: '-command', + static_args: [] } ] expect(configIsValid(config)).toBeFalsy() @@ -157,7 +169,8 @@ describe('command-helper tests', () => { issue_type: 'test-case-invalid-issue-type', allow_edits: false, repository: 'peter-evans/slash-command-dispatch', - event_type_suffix: '-command' + event_type_suffix: '-command', + static_args: [] } ] expect(configIsValid(config)).toBeFalsy() @@ -178,6 +191,7 @@ describe('command-helper tests', () => { test('slash command payload', async () => { const commandWords = ['test', 'arg1', 'arg2', 'arg3'] + const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', args: { @@ -191,11 +205,12 @@ describe('command-helper tests', () => { named: {} } } - expect(getSlashCommandPayload(commandWords)).toEqual(payload) + expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) }) test('slash command payload with named args', async () => { const commandWords = ['test', 'branch=master', 'arg1', 'env=prod', 'arg2'] + const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', args: { @@ -211,11 +226,34 @@ describe('command-helper tests', () => { } } } - expect(getSlashCommandPayload(commandWords)).toEqual(payload) + expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) + }) + + test('slash command payload with named args and static args', async () => { + const commandWords = ['test', 'branch=master', 'arg1', 'arg2'] + const staticArgs = ['production', 'region=us-east-1'] + const payload: SlashCommandPayload = { + command: 'test', + args: { + all: 'production region=us-east-1 branch=master arg1 arg2', + unnamed: { + all: 'production arg1 arg2', + arg1: 'production', + arg2: 'arg1', + arg3: 'arg2' + }, + named: { + region: 'us-east-1', + branch: 'master' + } + } + } + expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) }) test('slash command payload with malformed named args', async () => { const commandWords = ['test', 'branch=', 'arg1', 'e-nv=prod', 'arg2'] + const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', args: { @@ -230,6 +268,6 @@ describe('command-helper tests', () => { named: {} } } - expect(getSlashCommandPayload(commandWords)).toEqual(payload) + expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) }) }) diff --git a/action.yml b/action.yml index 109df914c..7cc4503cd 100644 --- a/action.yml +++ b/action.yml @@ -28,6 +28,8 @@ inputs: event-type-suffix: description: 'The repository dispatch event type suffix for the commands.' default: -command + static-args: + description: 'A comma or newline separated list of arguments that will be dispatched with every command.' config: description: 'JSON configuration for commands.' config-from-file: diff --git a/dist/index.js b/dist/index.js index 4974ff845..09ad8b77d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -636,7 +636,7 @@ function run() { // Dispatch for each matching configuration for (const cmd of configMatches) { // Generate slash command payload - clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords); + clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords, cmd.static_args); core.debug(`Slash command payload: ${util_1.inspect(clientPayload.slash_command)}`); // Dispatch the command const dispatchRepo = cmd.repository.split('/'); @@ -955,7 +955,8 @@ exports.commandDefaults = Object.freeze({ issue_type: 'both', allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', - event_type_suffix: '-command' + event_type_suffix: '-command', + static_args: [] }); function toBool(input, defaultVal) { if (typeof input === 'boolean') { @@ -981,6 +982,7 @@ function getInputs() { allowEdits: core.getInput('allow-edits') === 'true', repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), + staticArgs: utils.getInputAsArray('static-args'), config: core.getInput('config'), configFromFile: core.getInput('config-from-file') }; @@ -1015,7 +1017,8 @@ function getCommandsConfigFromInputs(inputs) { issue_type: inputs.issueType, allow_edits: inputs.allowEdits, repository: inputs.repository, - event_type_suffix: inputs.eventTypeSuffix + event_type_suffix: inputs.eventTypeSuffix, + static_args: inputs.staticArgs }; config.push(cmd); } @@ -1035,7 +1038,8 @@ function getCommandsConfigFromJson(json) { repository: jc.repository ? jc.repository : exports.commandDefaults.repository, event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix - : exports.commandDefaults.event_type_suffix + : exports.commandDefaults.event_type_suffix, + static_args: jc.static_args ? jc.static_args : exports.commandDefaults.static_args }; config.push(cmd); } @@ -1087,7 +1091,7 @@ function addReaction(octokit, repo, commentId, reaction) { }); } exports.addReaction = addReaction; -function getSlashCommandPayload(commandWords) { +function getSlashCommandPayload(commandWords, staticArgs) { const payload = { command: commandWords[0], args: { @@ -1098,8 +1102,11 @@ function getSlashCommandPayload(commandWords) { named: {} } }; - if (commandWords.length > 1) { - const argWords = commandWords.slice(1, exports.MAX_ARGS + 1); + // Get arguments if they exist + const argWords = commandWords.length > 1 ? commandWords.slice(1, exports.MAX_ARGS + 1) : []; + // Add static arguments if they exist + argWords.unshift(...staticArgs); + if (argWords.length > 0) { payload.args.all = argWords.join(' '); // Parse named and unnamed args let unnamedCount = 1; diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index a6560c9c8..3e1dd3a89 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -53,7 +53,11 @@ jobs: "command": "integration-test", "permission": "write", "issue_type": "both", - "repository": "peter-evans/slash-command-dispatch-processor" + "repository": "peter-evans/slash-command-dispatch-processor", + "static_args": [ + "production", + "region=us-east-1" + ] }, { "command": "create-ticket", @@ -100,5 +104,6 @@ Advanced configuration requires a combination of yaml based inputs and JSON conf | | `allow_edits` | Allow edited comments to trigger command dispatches. | `false` | | | `repository` | The full name of the repository to send the dispatch events. | Current repository | | | `event_type_suffix` | The repository dispatch event type suffix for the command. | `-command` | +| | `static_args` | A string array of arguments that will be dispatched with the command. | `[]` | | `config` | | JSON configuration for commands. | | | `config-from-file` | | JSON configuration from a file for commands. | | diff --git a/docs/updating.md b/docs/updating.md index ad58be5b9..3ffbb2324 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -7,6 +7,7 @@ ### New features - The `commands` input can now be newline separated, or comma separated. + e.g. ```yml commands: | @@ -14,3 +15,19 @@ integration-test build-docs ``` + +- Added a new input `static-args` (standard configuration), and a new JSON property `static_args` (advanced configuration). This is a list of arguments that will always be dispatched with commands. + + Standard configuration: + ```yml + static-args: | + production + region=us-east-1 + ``` + Advanced configuration: + ```yml + "static_args": [ + "production", + "region=us-east-1" + ] + ``` diff --git a/src/command-helper.ts b/src/command-helper.ts index c4d0689ef..85c484648 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -18,6 +18,7 @@ export interface Inputs { allowEdits: boolean repository: string eventTypeSuffix: string + staticArgs: string[] config: string configFromFile: string } @@ -29,6 +30,7 @@ export interface Command { allow_edits: boolean repository: string event_type_suffix: string + static_args: string[] } interface Repo { @@ -55,7 +57,8 @@ export const commandDefaults = Object.freeze({ issue_type: 'both', allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', - event_type_suffix: '-command' + event_type_suffix: '-command', + static_args: [] }) export function toBool(input: string, defaultVal: boolean): boolean { @@ -80,6 +83,7 @@ export function getInputs(): Inputs { allowEdits: core.getInput('allow-edits') === 'true', repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), + staticArgs: utils.getInputAsArray('static-args'), config: core.getInput('config'), configFromFile: core.getInput('config-from-file') } @@ -113,7 +117,8 @@ export function getCommandsConfigFromInputs(inputs: Inputs): Command[] { issue_type: inputs.issueType, allow_edits: inputs.allowEdits, repository: inputs.repository, - event_type_suffix: inputs.eventTypeSuffix + event_type_suffix: inputs.eventTypeSuffix, + static_args: inputs.staticArgs } config.push(cmd) } @@ -134,7 +139,8 @@ export function getCommandsConfigFromJson(json: string): Command[] { repository: jc.repository ? jc.repository : commandDefaults.repository, event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix - : commandDefaults.event_type_suffix + : commandDefaults.event_type_suffix, + static_args: jc.static_args ? jc.static_args : commandDefaults.static_args } config.push(cmd) } @@ -213,7 +219,8 @@ export async function addReaction( } export function getSlashCommandPayload( - commandWords: string[] + commandWords: string[], + staticArgs: string[] ): SlashCommandPayload { const payload: SlashCommandPayload = { command: commandWords[0], @@ -225,8 +232,12 @@ export function getSlashCommandPayload( named: {} } } - if (commandWords.length > 1) { - const argWords = commandWords.slice(1, MAX_ARGS + 1) + // Get arguments if they exist + const argWords = + commandWords.length > 1 ? commandWords.slice(1, MAX_ARGS + 1) : [] + // Add static arguments if they exist + argWords.unshift(...staticArgs) + if (argWords.length > 0) { payload.args.all = argWords.join(' ') // Parse named and unnamed args let unnamedCount = 1 diff --git a/src/main.ts b/src/main.ts index 35abb9aad..04399df80 100644 --- a/src/main.ts +++ b/src/main.ts @@ -170,7 +170,10 @@ async function run(): Promise { // Dispatch for each matching configuration for (const cmd of configMatches) { // Generate slash command payload - clientPayload.slash_command = getSlashCommandPayload(commandWords) + clientPayload.slash_command = getSlashCommandPayload( + commandWords, + cmd.static_args + ) core.debug( `Slash command payload: ${inspect(clientPayload.slash_command)}` ) From 27e527b62ed3b32f43b2f07ec476803a94626a43 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 21 Jul 2020 18:48:49 +0900 Subject: [PATCH 07/33] Update documentation --- docs/updating.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/updating.md b/docs/updating.md index 3ffbb2324..383e2f6fe 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -2,6 +2,31 @@ ### Breaking changes +- The format of the `slash_command` context has been changed to prevent an issue where named arguments can overwrite other properties of the payload. + + The following is an example of the new `slash_command` context. The slash command `/deploy branch=master env=prod some other args` will be converted to a JSON payload as follows. + + ```json + "slash_command": { + "command": "deploy", + "args": { + "all": "branch=master env=prod some other args", + "unnamed": { + "all": "some other args", + "arg1": "some", + "arg2": "other", + "arg3": "args" + }, + "named": { + "branch": "master", + "env": "prod" + }, + } + } + ``` + +- The `named-args` input (standard configuration) and `named_args` JSON property (advanced configuration) have been removed. Named arguments will now always be parsed and added to the `slash_command` context. + - The `client_payload.github.payload.issue.body` and `client_payload.pull_request.body` context properties will now be truncated if they exceed 1000 characters. ### New features From d560454706147ed27e85e6672119649411091fa2 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 11:16:39 +0900 Subject: [PATCH 08/33] Add dispatch-type and support for workflow dispatch --- .eslintrc.json | 3 +- .github/slash-command-dispatch.json | 6 + README.md | 25 ++- __test__/command-helper.test.ts | 38 +++- action.yml | 5 +- dist/index.js | 203 +++++++++++++++----- docs/advanced-configuration.md | 4 +- docs/updating.md | 5 +- docs/workflow-dispatch.md | 92 +++++++++ package-lock.json | 2 +- package.json | 5 +- src/command-helper.ts | 68 ++----- src/github-helper.ts | 285 ++++++++++++++++++++++++++++ src/main.ts | 46 ++--- src/octokit-client.ts | 2 + 15 files changed, 642 insertions(+), 147 deletions(-) create mode 100644 docs/workflow-dispatch.md create mode 100644 src/github-helper.ts diff --git a/.eslintrc.json b/.eslintrc.json index 799df884c..01d8ff980 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,6 +14,7 @@ ], "plugins": ["@typescript-eslint"], "rules": { - "@typescript-eslint/camelcase": "off" + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/ban-types": "warn" } } diff --git a/.github/slash-command-dispatch.json b/.github/slash-command-dispatch.json index 33cfede19..5ba6dadea 100644 --- a/.github/slash-command-dispatch.json +++ b/.github/slash-command-dispatch.json @@ -15,6 +15,12 @@ "foo=bar" ] }, + { + "command": "update", + "permission": "write", + "issue_type": "issue", + "dispatch_type": "workflow" + }, { "command": "do-something-remotely", "permission": "write", diff --git a/README.md b/README.md index 802ff3b41..5a9187e47 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,15 @@ [![CI](https://github.com/peter-evans/slash-command-dispatch/workflows/CI/badge.svg)](https://github.com/peter-evans/slash-command-dispatch/actions?query=workflow%3ACI) [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Slash%20Command%20Dispatch-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/slash-command-dispatch) -A GitHub action that facilitates ["ChatOps"](https://www.pagerduty.com/blog/what-is-chatops/) by creating repository dispatch events for slash commands. +A GitHub action that facilitates ["ChatOps"](https://www.pagerduty.com/blog/what-is-chatops/) by creating dispatch events for slash commands. ### How does it work? The action runs in `issue_comment` event workflows and checks the first line of comments for slash commands. -When a valid command is found it creates a repository dispatch event that includes a payload containing full details of the command and its context. +When a valid command is found it creates a [repository dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch) event that includes a payload containing full details of the command and its context. +It also supports creating [workflow dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events with defined input parameters. -### Why repository dispatch? +### Why create dispatch events? "ChatOps" with slash commands can work in a basic way by parsing the commands during `issue_comment` events and immediately processing the command. In repositories with a lot of activity, the workflow queue will get backed up very quickly trying to handle new `issue_comment` events *and* process the commands themselves. @@ -32,6 +33,7 @@ See it in action with the following live demos. - [Examples](docs/examples.md) - [Standard configuration](#standard-configuration) - [Advanced configuration](docs/advanced-configuration.md) +- [Workflow dispatch](docs/workflow-dispatch.md) - [Updating to v2](docs/updating.md) ## Dispatching commands @@ -59,7 +61,7 @@ jobs: build-docs ``` -Note that not specifying the `repository` input will mean that `repository_dispatch` events are created in the *current* repository by default. It's perfectly fine to use the current repository and not dispatch events to a seperate "processor" repository. +Note that not specifying the `repository` input will mean that dispatch events are created in the *current* repository by default. It's perfectly fine to use the current repository and not dispatch events to a seperate "processor" repository. This action also features [advanced configuration](docs/advanced-configuration.md) that allows each command to be configured individually if necessary. Use the standard configuration shown above unless you require advanced features. @@ -77,13 +79,14 @@ This action also features [advanced configuration](docs/advanced-configuration.m | `repository` | The full name of the repository to send the dispatch events. | Current repository | | `event-type-suffix` | The repository dispatch event type suffix for the commands. | `-command` | | `static-args` | A comma or newline separated list of arguments that will be dispatched with every command. | | +| `dispatch-type` | The dispatch type; `repository` or `workflow`. See [dispatch-type](#dispatch-type) for further details. | `repository` | | `config` | | JSON configuration for commands. See [Advanced configuration](docs/advanced-configuration.md) | | | `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](docs/advanced-configuration.md) | | #### `token` -This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. -The default `GITHUB_TOKEN` does not have scopes to do this so a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required. +This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) and [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. +The default `GITHUB_TOKEN` does not have scopes to create these events, so a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required. If you will be dispatching commands to public repositories *only* then you can use the more limited `public_repo` scope. #### `reaction-token` @@ -104,6 +107,13 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c build-docs ``` +#### `dispatch-type` + +By default, the action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. +Setting `dispatch-type` to `workflow` will instead create [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. + +There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](docs/workflow-dispatch.md) for usage details. + ### How comments are parsed for slash commands Slash commands must be placed in the first line of the comment to be interpreted as a command. @@ -116,6 +126,9 @@ Slash commands must be placed in the first line of the comment to be interpreted ## Handling dispatched commands +The following documentation applies to the `dispatch-type` default, `repository`, which creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. +For `workflow` dispatch documentation, see [workflow dispatch](docs/workflow-dispatch.md). + ### Event types Repository dispatch events have a `type` to distinguish between events. The `type` set by the action is a combination of the slash command and `event-type-suffix`. The `event-type-suffix` input defaults to `-command`. diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index e09f79aa7..952833e64 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -25,6 +25,7 @@ describe('command-helper tests', () => { repository: '', eventTypeSuffix: '-command', staticArgs: [], + dispatchType: 'repository', config: '', configFromFile: '' } @@ -40,6 +41,7 @@ describe('command-helper tests', () => { commandDefaults.event_type_suffix ) expect(config[i].static_args).toEqual(commandDefaults.static_args) + expect(config[i].dispatch_type).toEqual(commandDefaults.dispatch_type) } }) @@ -56,6 +58,7 @@ describe('command-helper tests', () => { repository: 'owner/repo', eventTypeSuffix: '-cmd', staticArgs: ['production', 'region=us-east-1'], + dispatchType: 'workflow', config: '', configFromFile: '' } @@ -69,6 +72,7 @@ describe('command-helper tests', () => { expect(config[i].repository).toEqual(inputs.repository) expect(config[i].event_type_suffix).toEqual(inputs.eventTypeSuffix) expect(config[i].static_args).toEqual(inputs.staticArgs) + expect(config[i].dispatch_type).toEqual(inputs.dispatchType) } }) @@ -93,7 +97,8 @@ describe('command-helper tests', () => { expect(config[i].event_type_suffix).toEqual( commandDefaults.event_type_suffix ) - expect(config[i].static_args).toEqual(commandDefaults.static_args) + expect(config[i].static_args).toEqual(commandDefaults.static_args), + expect(config[i].dispatch_type).toEqual(commandDefaults.dispatch_type) } }) @@ -113,7 +118,8 @@ describe('command-helper tests', () => { "static_args": [ "production", "region=us-east-1" - ] + ], + "dispatch_type": "workflow" } ]` const commands = ['do-stuff', 'test-all-the-things'] @@ -125,10 +131,13 @@ describe('command-helper tests', () => { expect(config[0].allow_edits).toBeTruthy() expect(config[0].repository).toEqual('owner/repo') expect(config[0].event_type_suffix).toEqual('-cmd') + expect(config[0].static_args).toEqual([]) + expect(config[0].dispatch_type).toEqual('repository') expect(config[1].command).toEqual(commands[1]) expect(config[1].permission).toEqual('read') expect(config[1].issue_type).toEqual(commandDefaults.issue_type) expect(config[1].static_args).toEqual(['production', 'region=us-east-1']) + expect(config[1].dispatch_type).toEqual('workflow') }) test('valid config', async () => { @@ -140,7 +149,8 @@ describe('command-helper tests', () => { allow_edits: false, repository: 'peter-evans/slash-command-dispatch', event_type_suffix: '-command', - static_args: [] + static_args: [], + dispatch_type: 'repository' } ] expect(configIsValid(config)).toBeTruthy() @@ -155,7 +165,8 @@ describe('command-helper tests', () => { allow_edits: false, repository: 'peter-evans/slash-command-dispatch', event_type_suffix: '-command', - static_args: [] + static_args: [], + dispatch_type: 'repository' } ] expect(configIsValid(config)).toBeFalsy() @@ -170,7 +181,24 @@ describe('command-helper tests', () => { allow_edits: false, repository: 'peter-evans/slash-command-dispatch', event_type_suffix: '-command', - static_args: [] + static_args: [], + dispatch_type: 'repository' + } + ] + expect(configIsValid(config)).toBeFalsy() + }) + + test('invalid dispatch type in config', async () => { + const config: Command[] = [ + { + command: 'test', + permission: 'write', + issue_type: 'test-case-invalid-issue-type', + allow_edits: false, + repository: 'peter-evans/slash-command-dispatch', + event_type_suffix: '-command', + static_args: [], + dispatch_type: 'test-case-invalid-dispatch-type' } ] expect(configIsValid(config)).toBeFalsy() diff --git a/action.yml b/action.yml index 7cc4503cd..a6b8dda39 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: 'Slash Command Dispatch' -description: 'Facilitates "ChatOps" by creating repository dispatch events for slash commands' +description: 'Facilitates "ChatOps" by creating dispatch events for slash commands' inputs: token: description: 'A repo scoped GitHub Personal Access Token.' @@ -30,6 +30,9 @@ inputs: default: -command static-args: description: 'A comma or newline separated list of arguments that will be dispatched with every command.' + dispatch-type: + description: 'The dispatch type; `repository` or `workflow`.' + default: repository config: description: 'JSON configuration for commands.' config-from-file: diff --git a/dist/index.js b/dist/index.js index 09ad8b77d..b2440c373 100644 --- a/dist/index.js +++ b/dist/index.js @@ -520,7 +520,7 @@ const core = __importStar(__webpack_require__(470)); const github = __importStar(__webpack_require__(469)); const util_1 = __webpack_require__(669); const command_helper_1 = __webpack_require__(372); -const octokit_client_1 = __webpack_require__(921); +const github_helper_1 = __webpack_require__(718); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -595,15 +595,15 @@ function run() { return; } } - // Set octokit clients - const octokit = new octokit_client_1.Octokit({ auth: `${inputs.token}` }); - const reactionOctokit = new octokit_client_1.Octokit({ auth: `${inputs.reactionToken}` }); + // Create github clients + const githubHelper = new github_helper_1.GitHubHelper(inputs.token); + const githubHelperReaction = new github_helper_1.GitHubHelper(inputs.reactionToken); // At this point we know the command is registered // Add the "eyes" reaction to the comment if (inputs.reactions) - yield command_helper_1.addReaction(reactionOctokit, github.context.repo, commentId, 'eyes'); + yield githubHelperReaction.tryAddReaction(github.context.repo, commentId, 'eyes'); // Get the actor permission - const actorPermission = yield command_helper_1.getActorPermission(octokit, github.context.repo, github.context.actor); + const actorPermission = yield githubHelper.getActorPermission(github.context.repo, github.context.actor); core.debug(`Actor permission: ${actorPermission}`); // Filter matching commands by the user's permission level configMatches = configMatches.filter(function (cmd) { @@ -618,7 +618,6 @@ function run() { core.info(`Command '${commandWords[0]}' to be dispatched.`); // Define payload const clientPayload = { - slash_command: {}, github: github.context }; // Truncate the body to keep the size of the payload under the max @@ -628,7 +627,7 @@ function run() { } // Get the pull request context for the dispatch payload if (isPullRequest) { - const { data: pullRequest } = yield octokit.pulls.get(Object.assign(Object.assign({}, github.context.repo), { pull_number: github.context.payload.issue.number })); + const pullRequest = yield githubHelper.getPull(github.context.repo, github.context.payload.issue.number); // Truncate the body to keep the size of the payload under the max pullRequest.body = pullRequest.body.slice(0, 1000); clientPayload['pull_request'] = pullRequest; @@ -639,20 +638,11 @@ function run() { clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords, cmd.static_args); core.debug(`Slash command payload: ${util_1.inspect(clientPayload.slash_command)}`); // Dispatch the command - const dispatchRepo = cmd.repository.split('/'); - const eventType = cmd.command + cmd.event_type_suffix; - yield octokit.repos.createDispatchEvent({ - owner: dispatchRepo[0], - repo: dispatchRepo[1], - event_type: eventType, - client_payload: clientPayload - }); - core.info(`Command '${cmd.command}' dispatched to '${cmd.repository}' ` + - `with event type '${eventType}'.`); + yield githubHelper.createDispatch(cmd, clientPayload); } // Add the "rocket" reaction to the comment if (inputs.reactions) - yield command_helper_1.addReaction(reactionOctokit, github.context.repo, commentId, 'rocket'); + yield githubHelperReaction.tryAddReaction(github.context.repo, commentId, 'rocket'); } catch (error) { core.debug(util_1.inspect(error)); @@ -933,17 +923,8 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSlashCommandPayload = exports.addReaction = exports.getActorPermission = exports.actorHasPermission = exports.configIsValid = exports.getCommandsConfigFromJson = exports.getCommandsConfigFromInputs = exports.getCommandsConfig = exports.getInputs = exports.toBool = exports.commandDefaults = exports.MAX_ARGS = void 0; +exports.getSlashCommandPayload = exports.actorHasPermission = exports.configIsValid = exports.getCommandsConfigFromJson = exports.getCommandsConfigFromInputs = exports.getCommandsConfig = exports.getInputs = exports.toBool = exports.commandDefaults = exports.MAX_ARGS = void 0; const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const util_1 = __webpack_require__(669); @@ -956,7 +937,8 @@ exports.commandDefaults = Object.freeze({ allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', event_type_suffix: '-command', - static_args: [] + static_args: [], + dispatch_type: 'repository' }); function toBool(input, defaultVal) { if (typeof input === 'boolean') { @@ -983,6 +965,7 @@ function getInputs() { repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), staticArgs: utils.getInputAsArray('static-args'), + dispatchType: core.getInput('dispatch-type'), config: core.getInput('config'), configFromFile: core.getInput('config-from-file') }; @@ -1018,7 +1001,8 @@ function getCommandsConfigFromInputs(inputs) { allow_edits: inputs.allowEdits, repository: inputs.repository, event_type_suffix: inputs.eventTypeSuffix, - static_args: inputs.staticArgs + static_args: inputs.staticArgs, + dispatch_type: inputs.dispatchType }; config.push(cmd); } @@ -1039,7 +1023,12 @@ function getCommandsConfigFromJson(json) { event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix : exports.commandDefaults.event_type_suffix, - static_args: jc.static_args ? jc.static_args : exports.commandDefaults.static_args + static_args: jc.static_args + ? jc.static_args + : exports.commandDefaults.static_args, + dispatch_type: jc.dispatch_type + ? jc.dispatch_type + : exports.commandDefaults.dispatch_type }; config.push(cmd); } @@ -1056,6 +1045,10 @@ function configIsValid(config) { core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`); return false; } + if (!['repository', 'workflow'].includes(command.dispatch_type)) { + core.setFailed(`'${command.dispatch_type}' is not a valid 'dispatch-type'.`); + return false; + } } return true; } @@ -1072,25 +1065,6 @@ function actorHasPermission(actorPermission, commandPermission) { return (permissionLevels[actorPermission] >= permissionLevels[commandPermission]); } exports.actorHasPermission = actorHasPermission; -function getActorPermission(octokit, repo, actor) { - return __awaiter(this, void 0, void 0, function* () { - const { data: { permission } } = yield octokit.repos.getCollaboratorPermissionLevel(Object.assign(Object.assign({}, repo), { username: actor })); - return permission; - }); -} -exports.getActorPermission = getActorPermission; -function addReaction(octokit, repo, commentId, reaction) { - return __awaiter(this, void 0, void 0, function* () { - try { - yield octokit.reactions.createForIssueComment(Object.assign(Object.assign({}, repo), { comment_id: commentId, content: reaction })); - } - catch (error) { - core.debug(util_1.inspect(error)); - core.warning(`Failed to set reaction on comment ID ${commentId}.`); - } - }); -} -exports.addReaction = addReaction; function getSlashCommandPayload(commandWords, staticArgs) { const payload = { command: commandWords[0], @@ -4676,6 +4650,133 @@ function isPlainObject(o) { module.exports = isPlainObject; +/***/ }), + +/***/ 718: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GitHubHelper = void 0; +const core = __importStar(__webpack_require__(470)); +const octokit_client_1 = __webpack_require__(921); +class GitHubHelper { + constructor(token) { + const options = {}; + if (token) { + options.auth = `${token}`; + } + this.octokit = new octokit_client_1.Octokit(options); + } + parseRepository(repository) { + const [owner, repo] = repository.split('/'); + return { + owner: owner, + repo: repo + }; + } + getActorPermission(repo, actor) { + return __awaiter(this, void 0, void 0, function* () { + const { data: { permission } } = yield this.octokit.repos.getCollaboratorPermissionLevel(Object.assign(Object.assign({}, repo), { username: actor })); + return permission; + }); + } + tryAddReaction(repo, commentId, reaction) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this.octokit.reactions.createForIssueComment(Object.assign(Object.assign({}, repo), { comment_id: commentId, content: reaction })); + } + catch (error) { + core.debug(error); + core.warning(`Failed to set reaction on comment ID ${commentId}.`); + } + }); + } + getPull(repo, pullNumber) { + return __awaiter(this, void 0, void 0, function* () { + const { data: pullRequest } = yield this.octokit.pulls.get(Object.assign(Object.assign({}, repo), { pull_number: pullNumber })); + return pullRequest; + }); + } + createDispatch(cmd, clientPayload) { + return __awaiter(this, void 0, void 0, function* () { + if (cmd.dispatch_type == 'repository') { + yield this.createRepositoryDispatch(cmd, clientPayload); + } + else { + yield this.createWorkflowDispatch(cmd, clientPayload); + } + }); + } + createRepositoryDispatch(cmd, clientPayload) { + return __awaiter(this, void 0, void 0, function* () { + const eventType = `${cmd.command}${cmd.event_type_suffix}`; + yield this.octokit.repos.createDispatchEvent(Object.assign(Object.assign({}, this.parseRepository(cmd.repository)), { event_type: `${cmd.command}${cmd.event_type_suffix}`, client_payload: clientPayload })); + core.info(`Command '${cmd.command}' dispatched to '${cmd.repository}' ` + + `with event type '${eventType}'.`); + }); + } + createWorkflowDispatch(cmd, clientPayload) { + return __awaiter(this, void 0, void 0, function* () { + const workflow = `${cmd.command}${cmd.event_type_suffix}.yml`; + const slashCommand = clientPayload.slash_command; + const ref = slashCommand.args.named.ref + ? slashCommand.args.named.ref + : yield this.getDefaultBranch(cmd.repository); + // Take max 10 named arguments, excluding 'ref'. + const inputs = {}; + let count = 0; + for (const key in slashCommand.args.named) { + if (key != 'ref') { + inputs[key] = slashCommand.args.named[key]; + count++; + } + if (count == 10) + break; + } + yield this.octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', Object.assign(Object.assign({}, this.parseRepository(cmd.repository)), { workflow_id: workflow, ref: ref, inputs: inputs })); + core.info(`Command '${cmd.command}' dispatched to workflow '${workflow}' in '${cmd.repository}'`); + }); + } + getDefaultBranch(repository) { + return __awaiter(this, void 0, void 0, function* () { + const { data: repo } = yield this.octokit.repos.get(Object.assign({}, this.parseRepository(repository))); + return repo.default_branch; + }); + } +} +exports.GitHubHelper = GitHubHelper; + + /***/ }), /***/ 747: diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index 3e1dd3a89..01c1ece94 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -64,7 +64,8 @@ jobs: "permission": "write", "issue_type": "issue", "allow_edits": true, - "event_type_suffix": "-cmd" + "event_type_suffix": "-cmd", + "dispatch_type": "workflow" } ] ``` @@ -105,5 +106,6 @@ Advanced configuration requires a combination of yaml based inputs and JSON conf | | `repository` | The full name of the repository to send the dispatch events. | Current repository | | | `event_type_suffix` | The repository dispatch event type suffix for the command. | `-command` | | | `static_args` | A string array of arguments that will be dispatched with the command. | `[]` | +| | `dispatch_type` | The dispatch type; `repository` or `workflow`. | `repository` | | `config` | | JSON configuration for commands. | | | `config-from-file` | | JSON configuration from a file for commands. | | diff --git a/docs/updating.md b/docs/updating.md index 383e2f6fe..6a05b0922 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -50,9 +50,12 @@ region=us-east-1 ``` Advanced configuration: - ```yml + ```json "static_args": [ "production", "region=us-east-1" ] ``` + + - Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. + There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](workflow-dispatch.md) for usage details. diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md new file mode 100644 index 000000000..2d83235f1 --- /dev/null +++ b/docs/workflow-dispatch.md @@ -0,0 +1,92 @@ +# Workflow dispatch + +This documentation applies when the `dispatch-type` input is set to `workflow`, which instructs the action to create [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. + +To learn about the `workflow_dispatch` event, see GitHub's documentation on [manually running a workflow](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow). + +## Action behaviour + +There are significant differences in the action's behaviour when using `workflow` dispatch. + +- When issuing a slash command with arguments, *only named arguments are accepted*. Unnamed arguments will be ignored. +- A maximum of 10 named arguments are accepted. Additional named arguments after the first 10 will be ignored. +- `ref` is a reserved named argument that does not count towards the maximum of 10. This is used to specify the target reference of the command. The reference can be a branch, tag, or a commit SHA. If you omit the `ref` argument, the target repository's default branch will be used. +- A `client_payload` context cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match the named arguments supplied with the slash command. + +## Handling dispatched commands + +### Workflow name + +It is important to name the `workflow_dispatch` event workflow correctly since the action targets the workflow based on its filename. The target filename is a combination of the command name and the `event-type-suffix`. + +For the following example configuration, the target workflows are: +- `deploy-command.yml` +- `integration-test-command.yml` +- `build-docs-command.yml` + +```yml +name: Slash Command Dispatch +on: + issue_comment: + types: [created] +jobs: + slashCommandDispatch: + runs-on: ubuntu-latest + steps: + - name: Slash Command Dispatch + uses: peter-evans/slash-command-dispatch@v2 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + commands: | + deploy + integration-test + build-docs + dispatch-type: workflow +``` + +### Responding to the comment on command completion + +In order to respond to the comment where the slash command was made we need to pass the `comment-id` and `repository` (if the target workflow is not in the current repository). Set static arguments as follows. Note that these static arguments will count towards the maximum of 10 named arguments. + +Using basic configuration: +```yml + static-args: | + repository=${{ github.repository }} + comment-id=${{ github.event.issue.comment-id }} +``` + +Using advanced configuration: +```json + "static_args": [ + "repository=${{ github.repository }}", + "comment-id=${{ github.event.issue.comment-id }}" + ] +``` + +The target workflow must define these arguments as inputs. + +```yml +on: + workflow_dispatch: + inputs: + repository: + description: 'The repository from which the slash command was dispatched' + required: true + comment-id: + description: 'The comment-id of the slash command' + required: true +``` + +Using [create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) action there are a number of ways you can respond to the comment once the command has completed. + +The simplest response is to add a :tada: reaction to the comment. + +```yml + - name: Add reaction + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + repository: ${{ github.event.inputs.repository }} + comment-id: ${{ github.event.inputs.comment-id }} + reaction-type: hooray +``` diff --git a/package-lock.json b/package-lock.json index 8c610fb6d..5f332164e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "slash-command-dispatch", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f11f69c48..99f4f6d96 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "slash-command-dispatch", "version": "2.0.0", "private": true, - "description": "Create repository dispatch events for slash commands", + "description": "Facilitates 'ChatOps' by creating dispatch events for slash commands", "main": "lib/main.js", "scripts": { "build": "tsc && ncc build", @@ -31,7 +31,8 @@ "@actions/github": "4.0.0", "@octokit/core": "3.1.1", "@octokit/plugin-paginate-rest": "2.2.3", - "@octokit/plugin-rest-endpoint-methods": "4.1.0" + "@octokit/plugin-rest-endpoint-methods": "4.1.0", + "@octokit/types": "5.1.0" }, "devDependencies": { "@types/jest": "26.0.5", diff --git a/src/command-helper.ts b/src/command-helper.ts index 85c484648..72cc1f794 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -1,7 +1,6 @@ import * as core from '@actions/core' import * as fs from 'fs' import {inspect} from 'util' -import {Octokit} from './octokit-client' import * as utils from './utils' const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/ @@ -19,6 +18,7 @@ export interface Inputs { repository: string eventTypeSuffix: string staticArgs: string[] + dispatchType: string config: string configFromFile: string } @@ -31,11 +31,7 @@ export interface Command { repository: string event_type_suffix: string static_args: string[] -} - -interface Repo { - owner: string - repo: string + dispatch_type: string } export interface SlashCommandPayload { @@ -58,7 +54,8 @@ export const commandDefaults = Object.freeze({ allow_edits: false, repository: process.env.GITHUB_REPOSITORY || '', event_type_suffix: '-command', - static_args: [] + static_args: [], + dispatch_type: 'repository' }) export function toBool(input: string, defaultVal: boolean): boolean { @@ -84,6 +81,7 @@ export function getInputs(): Inputs { repository: core.getInput('repository'), eventTypeSuffix: core.getInput('event-type-suffix'), staticArgs: utils.getInputAsArray('static-args'), + dispatchType: core.getInput('dispatch-type'), config: core.getInput('config'), configFromFile: core.getInput('config-from-file') } @@ -118,7 +116,8 @@ export function getCommandsConfigFromInputs(inputs: Inputs): Command[] { allow_edits: inputs.allowEdits, repository: inputs.repository, event_type_suffix: inputs.eventTypeSuffix, - static_args: inputs.staticArgs + static_args: inputs.staticArgs, + dispatch_type: inputs.dispatchType } config.push(cmd) } @@ -140,7 +139,12 @@ export function getCommandsConfigFromJson(json: string): Command[] { event_type_suffix: jc.event_type_suffix ? jc.event_type_suffix : commandDefaults.event_type_suffix, - static_args: jc.static_args ? jc.static_args : commandDefaults.static_args + static_args: jc.static_args + ? jc.static_args + : commandDefaults.static_args, + dispatch_type: jc.dispatch_type + ? jc.dispatch_type + : commandDefaults.dispatch_type } config.push(cmd) } @@ -157,6 +161,12 @@ export function configIsValid(config: Command[]): boolean { core.setFailed(`'${command.issue_type}' is not a valid 'issue-type'.`) return false } + if (!['repository', 'workflow'].includes(command.dispatch_type)) { + core.setFailed( + `'${command.dispatch_type}' is not a valid 'dispatch-type'.` + ) + return false + } } return true } @@ -178,46 +188,6 @@ export function actorHasPermission( ) } -export async function getActorPermission( - octokit: InstanceType, - repo: Repo, - actor: string -): Promise { - const { - data: {permission} - } = await octokit.repos.getCollaboratorPermissionLevel({ - ...repo, - username: actor - }) - return permission -} - -export async function addReaction( - octokit: InstanceType, - repo: Repo, - commentId: number, - reaction: - | '+1' - | '-1' - | 'laugh' - | 'confused' - | 'heart' - | 'hooray' - | 'rocket' - | 'eyes' -): Promise { - try { - await octokit.reactions.createForIssueComment({ - ...repo, - comment_id: commentId, - content: reaction - }) - } catch (error) { - core.debug(inspect(error)) - core.warning(`Failed to set reaction on comment ID ${commentId}.`) - } -} - export function getSlashCommandPayload( commandWords: string[], staticArgs: string[] diff --git a/src/github-helper.ts b/src/github-helper.ts new file mode 100644 index 000000000..830bb0c36 --- /dev/null +++ b/src/github-helper.ts @@ -0,0 +1,285 @@ +import * as core from '@actions/core' +import {Octokit, OctokitOptions, PullsGetResponseData} from './octokit-client' +import {Command, SlashCommandPayload} from './command-helper' + +type ReposCreateDispatchEventParamsClientPayload = { + [key: string]: ReposCreateDispatchEventParamsClientPayloadKeyString +} +type ReposCreateDispatchEventParamsClientPayloadKeyString = {} + +export interface ClientPayload + extends ReposCreateDispatchEventParamsClientPayload { + github: any + pull_request?: any + slash_command?: SlashCommandPayload | any +} + +interface Repository { + owner: string + repo: string +} + +export class GitHubHelper { + private octokit: InstanceType + + constructor(token: string) { + const options: OctokitOptions = {} + if (token) { + options.auth = `${token}` + } + this.octokit = new Octokit(options) + } + + private parseRepository(repository: string): Repository { + const [owner, repo] = repository.split('/') + return { + owner: owner, + repo: repo + } + } + + async getActorPermission(repo: Repository, actor: string): Promise { + const { + data: {permission} + } = await this.octokit.repos.getCollaboratorPermissionLevel({ + ...repo, + username: actor + }) + return permission + } + + async tryAddReaction( + repo: Repository, + commentId: number, + reaction: + | '+1' + | '-1' + | 'laugh' + | 'confused' + | 'heart' + | 'hooray' + | 'rocket' + | 'eyes' + ): Promise { + try { + await this.octokit.reactions.createForIssueComment({ + ...repo, + comment_id: commentId, + content: reaction + }) + } catch (error) { + core.debug(error) + core.warning(`Failed to set reaction on comment ID ${commentId}.`) + } + } + + async getPull( + repo: Repository, + pullNumber: number + ): Promise { + const {data: pullRequest} = await this.octokit.pulls.get({ + ...repo, + pull_number: pullNumber + }) + return pullRequest + } + + async createDispatch( + cmd: Command, + clientPayload: ClientPayload + ): Promise { + if (cmd.dispatch_type == 'repository') { + await this.createRepositoryDispatch(cmd, clientPayload) + } else { + await this.createWorkflowDispatch(cmd, clientPayload) + } + } + + private async createRepositoryDispatch( + cmd: Command, + clientPayload: ClientPayload + ): Promise { + const eventType = `${cmd.command}${cmd.event_type_suffix}` + await this.octokit.repos.createDispatchEvent({ + ...this.parseRepository(cmd.repository), + event_type: `${cmd.command}${cmd.event_type_suffix}`, + client_payload: clientPayload + }) + core.info( + `Command '${cmd.command}' dispatched to '${cmd.repository}' ` + + `with event type '${eventType}'.` + ) + } + + async createWorkflowDispatch( + cmd: Command, + clientPayload: ClientPayload + ): Promise { + const workflow = `${cmd.command}${cmd.event_type_suffix}.yml` + const slashCommand: SlashCommandPayload = clientPayload.slash_command + const ref = slashCommand.args.named.ref + ? slashCommand.args.named.ref + : await this.getDefaultBranch(cmd.repository) + + // Take max 10 named arguments, excluding 'ref'. + const inputs = {} + let count = 0 + for (const key in slashCommand.args.named) { + if (key != 'ref') { + inputs[key] = slashCommand.args.named[key] + count++ + } + if (count == 10) break + } + + await this.octokit.request( + 'POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', + { + ...this.parseRepository(cmd.repository), + workflow_id: workflow, + ref: ref, + inputs: inputs + } + ) + core.info( + `Command '${cmd.command}' dispatched to workflow '${workflow}' in '${cmd.repository}'` + ) + } + + private async getDefaultBranch(repository: string): Promise { + const {data: repo} = await this.octokit.repos.get({ + ...this.parseRepository(repository) + }) + return repo.default_branch + } + + // private async createOrUpdate( + // inputs: Inputs, + // baseRepository: string, + // headBranch: string + // ): Promise { + // // Try to create the pull request + // try { + // const {data: pull} = await this.octokit.pulls.create({ + // ...this.parseRepository(baseRepository), + // title: inputs.title, + // head: headBranch, + // base: inputs.base, + // body: inputs.body, + // draft: inputs.draft + // }) + // core.info( + // `Created pull request #${pull.number} (${headBranch} => ${inputs.base})` + // ) + // return pull.number + // } catch (e) { + // if ( + // !e.message || + // !e.message.includes(`A pull request already exists for ${headBranch}`) + // ) { + // throw e + // } + // } + + // // Update the pull request that exists for this branch and base + // const {data: pulls} = await this.octokit.pulls.list({ + // ...this.parseRepository(baseRepository), + // state: 'open', + // head: headBranch, + // base: inputs.base + // }) + // const {data: pull} = await this.octokit.pulls.update({ + // ...this.parseRepository(baseRepository), + // pull_number: pulls[0].number, + // title: inputs.title, + // body: inputs.body, + // draft: inputs.draft + // }) + // core.info( + // `Updated pull request #${pull.number} (${headBranch} => ${inputs.base})` + // ) + // return pull.number + // } + + // async getRepositoryParent(headRepository: string): Promise { + // const {data: headRepo} = await this.octokit.repos.get({ + // ...this.parseRepository(headRepository) + // }) + // if (!headRepo.parent) { + // throw new Error( + // `Repository '${headRepository}' is not a fork. Unable to continue.` + // ) + // } + // return headRepo.parent.full_name + // } + + // async createOrUpdatePullRequest( + // inputs: Inputs, + // baseRepository: string, + // headRepository: string + // ): Promise { + // const [headOwner] = headRepository.split('/') + // const headBranch = `${headOwner}:${inputs.branch}` + + // // Create or update the pull request + // const pullNumber = await this.createOrUpdate( + // inputs, + // baseRepository, + // headBranch + // ) + + // // Set outputs + // core.startGroup('Setting outputs') + // core.setOutput('pull-request-number', pullNumber) + // core.exportVariable('PULL_REQUEST_NUMBER', pullNumber) + // core.endGroup() + + // // Set milestone, labels and assignees + // const updateIssueParams = {} + // if (inputs.milestone) { + // updateIssueParams['milestone'] = inputs.milestone + // core.info(`Applying milestone '${inputs.milestone}'`) + // } + // if (inputs.labels.length > 0) { + // updateIssueParams['labels'] = inputs.labels + // core.info(`Applying labels '${inputs.labels}'`) + // } + // if (inputs.assignees.length > 0) { + // updateIssueParams['assignees'] = inputs.assignees + // core.info(`Applying assignees '${inputs.assignees}'`) + // } + // if (Object.keys(updateIssueParams).length > 0) { + // await this.octokit.issues.update({ + // ...this.parseRepository(baseRepository), + // issue_number: pullNumber, + // ...updateIssueParams + // }) + // } + + // // Request reviewers and team reviewers + // const requestReviewersParams = {} + // if (inputs.reviewers.length > 0) { + // requestReviewersParams['reviewers'] = inputs.reviewers + // core.info(`Requesting reviewers '${inputs.reviewers}'`) + // } + // if (inputs.teamReviewers.length > 0) { + // requestReviewersParams['team_reviewers'] = inputs.teamReviewers + // core.info(`Requesting team reviewers '${inputs.teamReviewers}'`) + // } + // if (Object.keys(requestReviewersParams).length > 0) { + // try { + // await this.octokit.pulls.requestReviewers({ + // ...this.parseRepository(baseRepository), + // pull_number: pullNumber, + // ...requestReviewersParams + // }) + // } catch (e) { + // if (e.message && e.message.includes(ERROR_PR_REVIEW_FROM_AUTHOR)) { + // core.warning(ERROR_PR_REVIEW_FROM_AUTHOR) + // } else { + // throw e + // } + // } + // } + // } +} diff --git a/src/main.ts b/src/main.ts index 04399df80..cfcf373c4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,11 +6,9 @@ import { getCommandsConfig, configIsValid, actorHasPermission, - getActorPermission, - addReaction, getSlashCommandPayload } from './command-helper' -import {Octokit} from './octokit-client' +import {GitHubHelper, ClientPayload} from './github-helper' async function run(): Promise { try { @@ -108,18 +106,21 @@ async function run(): Promise { } } - // Set octokit clients - const octokit = new Octokit({auth: `${inputs.token}`}) - const reactionOctokit = new Octokit({auth: `${inputs.reactionToken}`}) + // Create github clients + const githubHelper = new GitHubHelper(inputs.token) + const githubHelperReaction = new GitHubHelper(inputs.reactionToken) // At this point we know the command is registered // Add the "eyes" reaction to the comment if (inputs.reactions) - await addReaction(reactionOctokit, github.context.repo, commentId, 'eyes') + await githubHelperReaction.tryAddReaction( + github.context.repo, + commentId, + 'eyes' + ) // Get the actor permission - const actorPermission = await getActorPermission( - octokit, + const actorPermission = await githubHelper.getActorPermission( github.context.repo, github.context.actor ) @@ -141,8 +142,7 @@ async function run(): Promise { core.info(`Command '${commandWords[0]}' to be dispatched.`) // Define payload - const clientPayload = { - slash_command: {}, + const clientPayload: ClientPayload = { github: github.context } // Truncate the body to keep the size of the payload under the max @@ -158,10 +158,10 @@ async function run(): Promise { // Get the pull request context for the dispatch payload if (isPullRequest) { - const {data: pullRequest} = await octokit.pulls.get({ - ...github.context.repo, - pull_number: github.context.payload.issue.number - }) + const pullRequest = await githubHelper.getPull( + github.context.repo, + github.context.payload.issue.number + ) // Truncate the body to keep the size of the payload under the max pullRequest.body = pullRequest.body.slice(0, 1000) clientPayload['pull_request'] = pullRequest @@ -178,24 +178,12 @@ async function run(): Promise { `Slash command payload: ${inspect(clientPayload.slash_command)}` ) // Dispatch the command - const dispatchRepo = cmd.repository.split('/') - const eventType = cmd.command + cmd.event_type_suffix - await octokit.repos.createDispatchEvent({ - owner: dispatchRepo[0], - repo: dispatchRepo[1], - event_type: eventType, - client_payload: clientPayload - }) - core.info( - `Command '${cmd.command}' dispatched to '${cmd.repository}' ` + - `with event type '${eventType}'.` - ) + await githubHelper.createDispatch(cmd, clientPayload) } // Add the "rocket" reaction to the comment if (inputs.reactions) - await addReaction( - reactionOctokit, + await githubHelperReaction.tryAddReaction( github.context.repo, commentId, 'rocket' diff --git a/src/octokit-client.ts b/src/octokit-client.ts index 5e82c5d6b..a13b1a6eb 100644 --- a/src/octokit-client.ts +++ b/src/octokit-client.ts @@ -5,3 +5,5 @@ export {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods' export {OctokitOptions} from '@octokit/core/dist-types/types' export const Octokit = Core.plugin(paginateRest, restEndpointMethods) + +export {PullsGetResponseData} from '@octokit/types' From 6ce42eadf677d45ec24abf78756066787c794651 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 13:17:22 +0900 Subject: [PATCH 09/33] Permit hyphens in named arg keys --- __test__/command-helper.test.ts | 22 ++++++++++++++-------- dist/index.js | 2 +- src/command-helper.ts | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index 952833e64..1c077598c 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -237,20 +237,26 @@ describe('command-helper tests', () => { }) test('slash command payload with named args', async () => { - const commandWords = ['test', 'branch=master', 'arg1', 'env=prod', 'arg2'] + const commandWords = [ + 'test', + 'branch_name=master', + 'arg1', + 'test-id=123', + 'arg2' + ] const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', args: { - all: 'branch=master arg1 env=prod arg2', + all: 'branch_name=master arg1 test-id=123 arg2', unnamed: { all: 'arg1 arg2', arg1: 'arg1', arg2: 'arg2' }, named: { - branch: 'master', - env: 'prod' + branch_name: 'master', + 'test-id': '123' } } } @@ -280,17 +286,17 @@ describe('command-helper tests', () => { }) test('slash command payload with malformed named args', async () => { - const commandWords = ['test', 'branch=', 'arg1', 'e-nv=prod', 'arg2'] + const commandWords = ['test', 'branch=', 'arg1', 'e.nv=prod', 'arg2'] const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', args: { - all: 'branch= arg1 e-nv=prod arg2', + all: 'branch= arg1 e.nv=prod arg2', unnamed: { - all: 'branch= arg1 e-nv=prod arg2', + all: 'branch= arg1 e.nv=prod arg2', arg1: 'branch=', arg2: 'arg1', - arg3: 'e-nv=prod', + arg3: 'e.nv=prod', arg4: 'arg2' }, named: {} diff --git a/dist/index.js b/dist/index.js index b2440c373..2e1a66ff0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -929,7 +929,7 @@ const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const util_1 = __webpack_require__(669); const utils = __importStar(__webpack_require__(611)); -const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/; +const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_-]+)=(?[^\s]+)$/; exports.MAX_ARGS = 50; exports.commandDefaults = Object.freeze({ permission: 'write', diff --git a/src/command-helper.ts b/src/command-helper.ts index 72cc1f794..56714d08b 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -3,7 +3,7 @@ import * as fs from 'fs' import {inspect} from 'util' import * as utils from './utils' -const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_]+)=(?[^\s]+)$/ +const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_-]+)=(?[^\s]+)$/ export const MAX_ARGS = 50 From 54bdc6ae336c95e1ed49e7777ff73a763daa0037 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 13:41:31 +0900 Subject: [PATCH 10/33] Set input validation errors to action warnings --- dist/index.js | 12 +++++++++++- src/main.ts | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2e1a66ff0..c79f1ac6c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -646,7 +646,17 @@ function run() { } catch (error) { core.debug(util_1.inspect(error)); - core.setFailed(error.message); + const message = error.message; + if (message == 'Unexpected inputs provided') { + core.warning(message); + } + else if (message.startsWith('Required input') && + message.endsWith('not provided')) { + core.warning(message); + } + else { + core.setFailed(error.message); + } } }); } diff --git a/src/main.ts b/src/main.ts index cfcf373c4..35efb9073 100644 --- a/src/main.ts +++ b/src/main.ts @@ -190,7 +190,17 @@ async function run(): Promise { ) } catch (error) { core.debug(inspect(error)) - core.setFailed(error.message) + const message: string = error.message + if (message == 'Unexpected inputs provided') { + core.warning(message) + } else if ( + message.startsWith('Required input') && + message.endsWith('not provided') + ) { + core.warning(message) + } else { + core.setFailed(error.message) + } } } From e11ed23b612e92537a82581c84580aabbc77e3fc Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 13:43:42 +0900 Subject: [PATCH 11/33] Fix context ref --- docs/workflow-dispatch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index 2d83235f1..594899ea8 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -52,14 +52,14 @@ Using basic configuration: ```yml static-args: | repository=${{ github.repository }} - comment-id=${{ github.event.issue.comment-id }} + comment-id=${{ github.event.comment.id }} ``` Using advanced configuration: ```json "static_args": [ "repository=${{ github.repository }}", - "comment-id=${{ github.event.issue.comment-id }}" + "comment-id=${{ github.event.comment.id }}" ] ``` From 84cfb236f621ef411dc5a89f5f87e0283182bda0 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:01:23 +0900 Subject: [PATCH 12/33] Set error-message output for workflow validation errors --- dist/index.js | 8 +++----- src/main.ts | 9 ++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index c79f1ac6c..14c4b722f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -647,11 +647,9 @@ function run() { catch (error) { core.debug(util_1.inspect(error)); const message = error.message; - if (message == 'Unexpected inputs provided') { - core.warning(message); - } - else if (message.startsWith('Required input') && - message.endsWith('not provided')) { + if (message == 'Unexpected inputs provided' || + (message.startsWith('Required input') && message.endsWith('not provided'))) { + core.setOutput('error-message', message); core.warning(message); } else { diff --git a/src/main.ts b/src/main.ts index 35efb9073..9586a1736 100644 --- a/src/main.ts +++ b/src/main.ts @@ -191,12 +191,11 @@ async function run(): Promise { } catch (error) { core.debug(inspect(error)) const message: string = error.message - if (message == 'Unexpected inputs provided') { - core.warning(message) - } else if ( - message.startsWith('Required input') && - message.endsWith('not provided') + if ( + message == 'Unexpected inputs provided' || + (message.startsWith('Required input') && message.endsWith('not provided')) ) { + core.setOutput('error-message', message) core.warning(message) } else { core.setFailed(error.message) From 07cb140b30915db932f2e122771e100be565181a Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:16:58 +0900 Subject: [PATCH 13/33] Update documentation --- docs/assets/error-message-output.png | Bin 0 -> 86357 bytes docs/workflow-dispatch.md | 32 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 docs/assets/error-message-output.png diff --git a/docs/assets/error-message-output.png b/docs/assets/error-message-output.png new file mode 100644 index 0000000000000000000000000000000000000000..52028e1324df5648dc7b8a73496d86e5b575b6eb GIT binary patch literal 86357 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�}D^OIE$iD+qd)Z_@2 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

Y*1+?>`gHv6 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 U$nvi|>%fnmw$Ul{iHq0&1)JhlmH+?% literal 0 HcmV?d00001 diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index 594899ea8..936d2e169 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -90,3 +90,35 @@ The simplest response is to add a :tada: reaction to the comment. comment-id: ${{ github.event.inputs.comment-id }} reaction-type: hooray ``` + +### Action warnings + +When creating the [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event, the GitHub API will return validation errors. In the following cases the action will issue a warning (visible in the Actions log), and set the action output `error-message`. + +- `Required input '...' not provided`: A required input for the workflow was not supplied as a named argument. +- `Unexpected inputs provided`: Named arguments were supplied that are not defined as workflow inputs. + +The `error-message` output can be used to provide feedback to the user as follows. Note that the step needs an `id` to access the outputs. + +```yml + - name: Slash Command Dispatch + id: scd + uses: peter-evans/slash-command-dispatch@v2 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + commands: | + deploy + integration-test + build-docs + dispatch-type: workflow + + - name: Edit comment with error message + if: steps.scd.outputs.error-message + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ github.event.comment.id }} + body: | + > ${{ steps.scd.outputs.error-message }} +``` + +![Comment Parsing](assets/error-message-output.png) From dc8f8605f7aff3b4bf39bc257a8e5ab2cb135a17 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:26:10 +0900 Subject: [PATCH 14/33] Add hello-workflow command --- .github/workflows/slash-command-dispatch.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index c20da30d1..ed907028d 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -69,6 +69,19 @@ jobs: "repository": "peter-evans/slash-command-dispatch-processor", "event_type_suffix": "-pr-command" }, + { + "command": "hello-workflow", + "permission": "none", + "issue_type": "issue", + "repository": "peter-evans/slash-command-dispatch-processor", + "static_args": [ + "repository=${{ github.repository }}", + "comment-id=${{ github.event.comment.id }}", + "issue-number=${{ github.event.issue.number }}", + "actor=${{ github.actor }}" + ], + "dispatch_type": "workflow" + }, { "command": "ping", "permission": "none", From ce4c3e7d3c90a21a195adef70b5f0413d53830b6 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:29:54 +0900 Subject: [PATCH 15/33] Remove comments --- src/github-helper.ts | 130 ------------------------------------------- 1 file changed, 130 deletions(-) diff --git a/src/github-helper.ts b/src/github-helper.ts index 830bb0c36..38e0519fa 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -152,134 +152,4 @@ export class GitHubHelper { }) return repo.default_branch } - - // private async createOrUpdate( - // inputs: Inputs, - // baseRepository: string, - // headBranch: string - // ): Promise { - // // Try to create the pull request - // try { - // const {data: pull} = await this.octokit.pulls.create({ - // ...this.parseRepository(baseRepository), - // title: inputs.title, - // head: headBranch, - // base: inputs.base, - // body: inputs.body, - // draft: inputs.draft - // }) - // core.info( - // `Created pull request #${pull.number} (${headBranch} => ${inputs.base})` - // ) - // return pull.number - // } catch (e) { - // if ( - // !e.message || - // !e.message.includes(`A pull request already exists for ${headBranch}`) - // ) { - // throw e - // } - // } - - // // Update the pull request that exists for this branch and base - // const {data: pulls} = await this.octokit.pulls.list({ - // ...this.parseRepository(baseRepository), - // state: 'open', - // head: headBranch, - // base: inputs.base - // }) - // const {data: pull} = await this.octokit.pulls.update({ - // ...this.parseRepository(baseRepository), - // pull_number: pulls[0].number, - // title: inputs.title, - // body: inputs.body, - // draft: inputs.draft - // }) - // core.info( - // `Updated pull request #${pull.number} (${headBranch} => ${inputs.base})` - // ) - // return pull.number - // } - - // async getRepositoryParent(headRepository: string): Promise { - // const {data: headRepo} = await this.octokit.repos.get({ - // ...this.parseRepository(headRepository) - // }) - // if (!headRepo.parent) { - // throw new Error( - // `Repository '${headRepository}' is not a fork. Unable to continue.` - // ) - // } - // return headRepo.parent.full_name - // } - - // async createOrUpdatePullRequest( - // inputs: Inputs, - // baseRepository: string, - // headRepository: string - // ): Promise { - // const [headOwner] = headRepository.split('/') - // const headBranch = `${headOwner}:${inputs.branch}` - - // // Create or update the pull request - // const pullNumber = await this.createOrUpdate( - // inputs, - // baseRepository, - // headBranch - // ) - - // // Set outputs - // core.startGroup('Setting outputs') - // core.setOutput('pull-request-number', pullNumber) - // core.exportVariable('PULL_REQUEST_NUMBER', pullNumber) - // core.endGroup() - - // // Set milestone, labels and assignees - // const updateIssueParams = {} - // if (inputs.milestone) { - // updateIssueParams['milestone'] = inputs.milestone - // core.info(`Applying milestone '${inputs.milestone}'`) - // } - // if (inputs.labels.length > 0) { - // updateIssueParams['labels'] = inputs.labels - // core.info(`Applying labels '${inputs.labels}'`) - // } - // if (inputs.assignees.length > 0) { - // updateIssueParams['assignees'] = inputs.assignees - // core.info(`Applying assignees '${inputs.assignees}'`) - // } - // if (Object.keys(updateIssueParams).length > 0) { - // await this.octokit.issues.update({ - // ...this.parseRepository(baseRepository), - // issue_number: pullNumber, - // ...updateIssueParams - // }) - // } - - // // Request reviewers and team reviewers - // const requestReviewersParams = {} - // if (inputs.reviewers.length > 0) { - // requestReviewersParams['reviewers'] = inputs.reviewers - // core.info(`Requesting reviewers '${inputs.reviewers}'`) - // } - // if (inputs.teamReviewers.length > 0) { - // requestReviewersParams['team_reviewers'] = inputs.teamReviewers - // core.info(`Requesting team reviewers '${inputs.teamReviewers}'`) - // } - // if (Object.keys(requestReviewersParams).length > 0) { - // try { - // await this.octokit.pulls.requestReviewers({ - // ...this.parseRepository(baseRepository), - // pull_number: pullNumber, - // ...requestReviewersParams - // }) - // } catch (e) { - // if (e.message && e.message.includes(ERROR_PR_REVIEW_FROM_AUTHOR)) { - // core.warning(ERROR_PR_REVIEW_FROM_AUTHOR) - // } else { - // throw e - // } - // } - // } - // } } From d00afdd495139f6b78610ccf6e4d7363b6b86bd9 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:38:50 +0900 Subject: [PATCH 16/33] Fix test --- __test__/command-helper.test.ts | 3 +-- jest.config.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index 1c077598c..568ee7117 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -21,8 +21,7 @@ describe('command-helper tests', () => { permission: 'write', issueType: 'both', allowEdits: false, - // Should be the value of github.repository, but '' for tests - repository: '', + repository: 'peter-evans/slash-command-dispatch', eventTypeSuffix: '-command', staticArgs: [], dispatchType: 'repository', diff --git a/jest.config.js b/jest.config.js index 14e44f9f7..6a08d6fc0 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,3 +9,6 @@ module.exports = { }, verbose: true } +process.env = Object.assign(process.env, { + GITHUB_REPOSITORY: "peter-evans/slash-command-dispatch" +}) From f04fe36a130dcdb7d7e6278dda2464214dedafef Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:41:47 +0900 Subject: [PATCH 17/33] Update new features doc --- docs/updating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/updating.md b/docs/updating.md index 6a05b0922..9916ed436 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -57,5 +57,5 @@ ] ``` - - Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. +- Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](workflow-dispatch.md) for usage details. From f59323b20a6c85b2001d30b637d1d75ac172ba23 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:51:10 +0900 Subject: [PATCH 18/33] Update documentation --- action.yml | 3 +++ docs/workflow-dispatch.md | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index a6b8dda39..62a96e9b5 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,9 @@ inputs: description: 'JSON configuration for commands.' config-from-file: description: 'JSON configuration from a file for commands.' +outputs: + error-message: + description: 'Validation errors when using `workflow` dispatch.' runs: using: 'node12' main: 'dist/index.js' diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index 936d2e169..5c3ee71ee 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -91,14 +91,14 @@ The simplest response is to add a :tada: reaction to the comment. reaction-type: hooray ``` -### Action warnings +### Validation errors When creating the [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event, the GitHub API will return validation errors. In the following cases the action will issue a warning (visible in the Actions log), and set the action output `error-message`. -- `Required input '...' not provided`: A required input for the workflow was not supplied as a named argument. -- `Unexpected inputs provided`: Named arguments were supplied that are not defined as workflow inputs. +- `Required input '...' not provided` - A required input for the workflow was not supplied as a named argument. +- `Unexpected inputs provided` - Named arguments were supplied that are not defined as workflow inputs. -The `error-message` output can be used to provide feedback to the user as follows. Note that the step needs an `id` to access the outputs. +The `error-message` output can be used to provide feedback to the user as follows. Note that the action step needs an `id` to access the outputs. ```yml - name: Slash Command Dispatch From 894f0fbb5f64c457a2c959196ea0b249cd1a9c20 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:54:02 +0900 Subject: [PATCH 19/33] Update documentation --- docs/workflow-dispatch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index 5c3ee71ee..e56a01f33 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -91,7 +91,7 @@ The simplest response is to add a :tada: reaction to the comment. reaction-type: hooray ``` -### Validation errors +## Validation errors When creating the [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event, the GitHub API will return validation errors. In the following cases the action will issue a warning (visible in the Actions log), and set the action output `error-message`. From 543843b25c36163ac386ebcd36fb21fe20ee0e35 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 22 Jul 2020 14:56:09 +0900 Subject: [PATCH 20/33] Update readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5a9187e47..4e29dd5aa 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ This action also features [advanced configuration](docs/advanced-configuration.m #### `token` -This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) and [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. +This action creates [repository_dispatch](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) and [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The default `GITHUB_TOKEN` does not have scopes to create these events, so a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required. If you will be dispatching commands to public repositories *only* then you can use the more limited `public_repo` scope. @@ -109,7 +109,7 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c #### `dispatch-type` -By default, the action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. +By default, the action creates [repository_dispatch](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. Setting `dispatch-type` to `workflow` will instead create [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](docs/workflow-dispatch.md) for usage details. @@ -126,7 +126,7 @@ Slash commands must be placed in the first line of the comment to be interpreted ## Handling dispatched commands -The following documentation applies to the `dispatch-type` default, `repository`, which creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. +The following documentation applies to the `dispatch-type` default, `repository`, which creates [repository_dispatch](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. For `workflow` dispatch documentation, see [workflow dispatch](docs/workflow-dispatch.md). ### Event types From 6251f5ee9dbaede1c36e7f277939beef019d48d5 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 23 Jul 2020 10:30:59 +0900 Subject: [PATCH 21/33] Add support for quoted arguments --- README.md | 16 ++--- __test__/command-helper.test.ts | 118 ++++++++++++++++++++++++++++---- dist/index.js | 59 ++++++++++------ docs/updating.md | 10 +++ src/command-helper.ts | 37 +++++++--- src/main.ts | 21 +++--- 6 files changed, 202 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 4e29dd5aa..63c9ed90e 100644 --- a/README.md +++ b/README.md @@ -162,23 +162,22 @@ To demonstrate, take the following configuration as an example. region=us-east-1 ``` -For the above example configuration, the slash command `/deploy branch=master some other args` will be converted to a JSON payload as follows. +For the above example configuration, the slash command `/deploy branch=master dry-run reason="new feature"` will be converted to a JSON payload as follows. ```json "slash_command": { "command": "deploy", "args": { - "all": "production region=us-east-1 branch=master some other args", + "all": "production region=us-east-1 branch=master dry-run reason=\"new feature\"", "unnamed": { - "all": "production some other args", + "all": "production dry-run", "arg1": "production", - "arg2": "some", - "arg3": "other", - "arg4": "args" + "arg2": "dry-run" }, "named": { "region": "us-east-1", - "branch": "master" + "branch": "master", + "reason": "new feature" }, } } @@ -194,10 +193,9 @@ The properties in the `slash_command` context from the above example can be used echo ${{ github.event.client_payload.slash_command.args.unnamed.all }} echo ${{ github.event.client_payload.slash_command.args.unnamed.arg1 }} echo ${{ github.event.client_payload.slash_command.args.unnamed.arg2 }} - echo ${{ github.event.client_payload.slash_command.args.unnamed.arg3 }} - echo ${{ github.event.client_payload.slash_command.args.unnamed.arg4 }} echo ${{ github.event.client_payload.slash_command.args.named.region }} echo ${{ github.event.client_payload.slash_command.args.named.branch }} + echo ${{ github.event.client_payload.slash_command.args.named.reason }} # etc. ``` diff --git a/__test__/command-helper.test.ts b/__test__/command-helper.test.ts index 568ee7117..de6ac88e4 100644 --- a/__test__/command-helper.test.ts +++ b/__test__/command-helper.test.ts @@ -7,6 +7,7 @@ import { getCommandsConfigFromJson, actorHasPermission, configIsValid, + tokeniseCommand, getSlashCommandPayload } from '../lib/command-helper' @@ -216,8 +217,36 @@ describe('command-helper tests', () => { expect(actorHasPermission('write', 'write')).toBeTruthy() }) - test('slash command payload', async () => { - const commandWords = ['test', 'arg1', 'arg2', 'arg3'] + test('command arguments are correctly tokenised', async () => { + const command = `a b=c "d e" f-g="h i" "j \\"k\\"" l="m \\"n\\" o"` + const commandTokens = [ + `a`, + `b=c`, + `"d e"`, + `f-g="h i"`, + `"j \\"k\\""`, + `l="m \\"n\\" o"` + ] + expect(tokeniseCommand(command)).toEqual(commandTokens) + }) + + test('tokenisation of malformed command arguments', async () => { + const command = `test arg named= quoted arg" named-arg="with \\"quoted value` + const commandTokens = [ + 'test', + 'arg', + 'named=', + 'quoted', + `arg"`, + `named-arg="with`, + '\\"quoted', + 'value' + ] + expect(tokeniseCommand(command)).toEqual(commandTokens) + }) + + test('slash command payload with unnamed args', async () => { + const commandTokens = ['test', 'arg1', 'arg2', 'arg3'] const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', @@ -232,11 +261,11 @@ describe('command-helper tests', () => { named: {} } } - expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) }) test('slash command payload with named args', async () => { - const commandWords = [ + const commandTokens = [ 'test', 'branch_name=master', 'arg1', @@ -259,21 +288,21 @@ describe('command-helper tests', () => { } } } - expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) }) test('slash command payload with named args and static args', async () => { - const commandWords = ['test', 'branch=master', 'arg1', 'arg2'] + const commandTokens = ['test', 'branch=master', 'arg1', 'dry-run'] const staticArgs = ['production', 'region=us-east-1'] const payload: SlashCommandPayload = { command: 'test', args: { - all: 'production region=us-east-1 branch=master arg1 arg2', + all: 'production region=us-east-1 branch=master arg1 dry-run', unnamed: { - all: 'production arg1 arg2', + all: 'production arg1 dry-run', arg1: 'production', arg2: 'arg1', - arg3: 'arg2' + arg3: 'dry-run' }, named: { region: 'us-east-1', @@ -281,11 +310,43 @@ describe('command-helper tests', () => { } } } - expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) + }) + + test('slash command payload with quoted args', async () => { + const commandTokens = [ + `test`, + `a`, + `b=c`, + `"d e"`, + `f-g="h i"`, + `"j \\"k\\""`, + `l="m \\"n\\" o"` + ] + const staticArgs = [`msg="x y z"`] + const payload: SlashCommandPayload = { + command: `test`, + args: { + all: `msg="x y z" a b=c "d e" f-g="h i" "j \\"k\\"" l="m \\"n\\" o"`, + unnamed: { + all: `a "d e" "j \\"k\\""`, + arg1: `a`, + arg2: `d e`, + arg3: `j \\"k\\"` + }, + named: { + msg: `x y z`, + b: `c`, + 'f-g': `h i`, + l: `m \\"n\\" o` + } + } + } + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) }) test('slash command payload with malformed named args', async () => { - const commandWords = ['test', 'branch=', 'arg1', 'e.nv=prod', 'arg2'] + const commandTokens = ['test', 'branch=', 'arg1', 'e.nv=prod', 'arg2'] const staticArgs = [] const payload: SlashCommandPayload = { command: 'test', @@ -301,6 +362,39 @@ describe('command-helper tests', () => { named: {} } } - expect(getSlashCommandPayload(commandWords, staticArgs)).toEqual(payload) + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) + }) + + test('slash command payload with malformed quoted args', async () => { + const commandTokens = [ + 'test', + 'arg', + 'named=', + 'quoted', + `arg"`, + `named-arg="with`, + `\\"quoted`, + 'value' + ] + const staticArgs = [] + const payload: SlashCommandPayload = { + command: 'test', + args: { + all: `arg named= quoted arg" named-arg="with \\"quoted value`, + unnamed: { + all: `arg named= quoted arg" \\"quoted value`, + arg1: 'arg', + arg2: 'named=', + arg3: 'quoted', + arg4: `arg"`, + arg5: `\\"quoted`, + arg6: 'value' + }, + named: { + 'named-arg': `"with` + } + } + } + expect(getSlashCommandPayload(commandTokens, staticArgs)).toEqual(payload) }) }) diff --git a/dist/index.js b/dist/index.js index 14c4b722f..d8f430f70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -559,16 +559,16 @@ function run() { console.debug('The first line of the comment is not a valid slash command.'); return; } - // Split the first line into "words" - const commandWords = firstLine.slice(1).split(' '); - core.debug(`Command words: ${util_1.inspect(commandWords)}`); + // Tokenise the first line (minus the leading slash) + const commandTokens = command_helper_1.tokeniseCommand(firstLine.slice(1)); + core.debug(`Command tokens: ${util_1.inspect(commandTokens)}`); // Check if the command is registered for dispatch let configMatches = config.filter(function (cmd) { - return cmd.command == commandWords[0]; + return cmd.command == commandTokens[0]; }); core.debug(`Config matches on 'command': ${util_1.inspect(configMatches)}`); if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not registered for dispatch.`); + core.info(`Command '${commandTokens[0]}' is not registered for dispatch.`); return; } // Filter matching commands by issue type @@ -581,7 +581,7 @@ function run() { core.debug(`Config matches on 'issue_type': ${util_1.inspect(configMatches)}`); if (configMatches.length == 0) { const issueType = isPullRequest ? 'pull request' : 'issue'; - core.info(`Command '${commandWords[0]}' is not configured for the issue type '${issueType}'.`); + core.info(`Command '${commandTokens[0]}' is not configured for the issue type '${issueType}'.`); return; } // Filter matching commands by whether or not to allow edits @@ -591,7 +591,7 @@ function run() { }); core.debug(`Config matches on 'allow_edits': ${util_1.inspect(configMatches)}`); if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not configured to allow edits.`); + core.info(`Command '${commandTokens[0]}' is not configured to allow edits.`); return; } } @@ -611,11 +611,11 @@ function run() { }); core.debug(`Config matches on 'permission': ${util_1.inspect(configMatches)}`); if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not configured for the user's permission level '${actorPermission}'.`); + core.info(`Command '${commandTokens[0]}' is not configured for the user's permission level '${actorPermission}'.`); return; } // Determined that the command should be dispatched - core.info(`Command '${commandWords[0]}' to be dispatched.`); + core.info(`Command '${commandTokens[0]}' to be dispatched.`); // Define payload const clientPayload = { github: github.context @@ -635,7 +635,7 @@ function run() { // Dispatch for each matching configuration for (const cmd of configMatches) { // Generate slash command payload - clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandWords, cmd.static_args); + clientPayload.slash_command = command_helper_1.getSlashCommandPayload(commandTokens, cmd.static_args); core.debug(`Slash command payload: ${util_1.inspect(clientPayload.slash_command)}`); // Dispatch the command yield githubHelper.createDispatch(cmd, clientPayload); @@ -932,12 +932,15 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSlashCommandPayload = exports.actorHasPermission = exports.configIsValid = exports.getCommandsConfigFromJson = exports.getCommandsConfigFromInputs = exports.getCommandsConfig = exports.getInputs = exports.toBool = exports.commandDefaults = exports.MAX_ARGS = void 0; +exports.getSlashCommandPayload = exports.tokeniseCommand = exports.actorHasPermission = exports.configIsValid = exports.getCommandsConfigFromJson = exports.getCommandsConfigFromInputs = exports.getCommandsConfig = exports.getInputs = exports.toBool = exports.commandDefaults = exports.MAX_ARGS = void 0; const core = __importStar(__webpack_require__(470)); const fs = __importStar(__webpack_require__(747)); const util_1 = __webpack_require__(669); const utils = __importStar(__webpack_require__(611)); -const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_-]+)=(?[^\s]+)$/; +// Tokenise command and arguments +// Support escaped quotes within quotes. https://stackoverflow.com/a/5696141/11934042 +const TOKENISE_REGEX = /\S+="[^"\\]*(?:\\.[^"\\]*)*"|"[^"\\]*(?:\\.[^"\\]*)*"|\S+/g; +const NAMED_ARG_REGEX = /^(?[a-zA-Z0-9_-]+)=(?.+)$/; exports.MAX_ARGS = 50; exports.commandDefaults = Object.freeze({ permission: 'write', @@ -1073,9 +1076,26 @@ function actorHasPermission(actorPermission, commandPermission) { return (permissionLevels[actorPermission] >= permissionLevels[commandPermission]); } exports.actorHasPermission = actorHasPermission; -function getSlashCommandPayload(commandWords, staticArgs) { +function tokeniseCommand(command) { + let matches; + const output = []; + while ((matches = TOKENISE_REGEX.exec(command))) { + output.push(matches[0]); + } + return output; +} +exports.tokeniseCommand = tokeniseCommand; +function stripQuotes(input) { + if (input.startsWith(`"`) && input.endsWith(`"`)) { + return input.slice(1, input.length - 1); + } + else { + return input; + } +} +function getSlashCommandPayload(commandTokens, staticArgs) { const payload = { - command: commandWords[0], + command: commandTokens[0], args: { all: '', unnamed: { @@ -1085,7 +1105,7 @@ function getSlashCommandPayload(commandWords, staticArgs) { } }; // Get arguments if they exist - const argWords = commandWords.length > 1 ? commandWords.slice(1, exports.MAX_ARGS + 1) : []; + const argWords = commandTokens.length > 1 ? commandTokens.slice(1, exports.MAX_ARGS + 1) : []; // Add static arguments if they exist argWords.unshift(...staticArgs); if (argWords.length > 0) { @@ -1094,16 +1114,15 @@ function getSlashCommandPayload(commandWords, staticArgs) { let unnamedCount = 1; const unnamedArgs = []; for (const argWord of argWords) { - if (NAMED_ARG_PATTERN.test(argWord)) { - const result = NAMED_ARG_PATTERN.exec(argWord); + if (NAMED_ARG_REGEX.test(argWord)) { + const result = NAMED_ARG_REGEX.exec(argWord); if (result && result.groups) { - payload.args.named[`${result.groups['name']}`] = - result.groups['value']; + payload.args.named[`${result.groups['name']}`] = stripQuotes(result.groups['value']); } } else { unnamedArgs.push(argWord); - payload.args.unnamed[`arg${unnamedCount}`] = argWord; + payload.args.unnamed[`arg${unnamedCount}`] = stripQuotes(argWord); unnamedCount += 1; } } diff --git a/docs/updating.md b/docs/updating.md index 9916ed436..c8f769eb0 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -57,5 +57,15 @@ ] ``` +- Slash command arguments can now be double-quoted to allow for argument values containing spaces. + + e.g. + ``` + /deploy branch=master dry-run reason="new feature" + ``` + ``` + /send "hello world!" + ``` + - Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](workflow-dispatch.md) for usage details. diff --git a/src/command-helper.ts b/src/command-helper.ts index 56714d08b..e5cac6e76 100644 --- a/src/command-helper.ts +++ b/src/command-helper.ts @@ -3,7 +3,10 @@ import * as fs from 'fs' import {inspect} from 'util' import * as utils from './utils' -const NAMED_ARG_PATTERN = /^(?[a-zA-Z0-9_-]+)=(?[^\s]+)$/ +// Tokenise command and arguments +// Support escaped quotes within quotes. https://stackoverflow.com/a/5696141/11934042 +const TOKENISE_REGEX = /\S+="[^"\\]*(?:\\.[^"\\]*)*"|"[^"\\]*(?:\\.[^"\\]*)*"|\S+/g +const NAMED_ARG_REGEX = /^(?[a-zA-Z0-9_-]+)=(?.+)$/ export const MAX_ARGS = 50 @@ -188,12 +191,29 @@ export function actorHasPermission( ) } +export function tokeniseCommand(command: string): string[] { + let matches + const output: string[] = [] + while ((matches = TOKENISE_REGEX.exec(command))) { + output.push(matches[0]) + } + return output +} + +function stripQuotes(input: string): string { + if (input.startsWith(`"`) && input.endsWith(`"`)) { + return input.slice(1, input.length - 1) + } else { + return input + } +} + export function getSlashCommandPayload( - commandWords: string[], + commandTokens: string[], staticArgs: string[] ): SlashCommandPayload { const payload: SlashCommandPayload = { - command: commandWords[0], + command: commandTokens[0], args: { all: '', unnamed: { @@ -204,7 +224,7 @@ export function getSlashCommandPayload( } // Get arguments if they exist const argWords = - commandWords.length > 1 ? commandWords.slice(1, MAX_ARGS + 1) : [] + commandTokens.length > 1 ? commandTokens.slice(1, MAX_ARGS + 1) : [] // Add static arguments if they exist argWords.unshift(...staticArgs) if (argWords.length > 0) { @@ -213,15 +233,16 @@ export function getSlashCommandPayload( let unnamedCount = 1 const unnamedArgs: string[] = [] for (const argWord of argWords) { - if (NAMED_ARG_PATTERN.test(argWord)) { - const result = NAMED_ARG_PATTERN.exec(argWord) + if (NAMED_ARG_REGEX.test(argWord)) { + const result = NAMED_ARG_REGEX.exec(argWord) if (result && result.groups) { - payload.args.named[`${result.groups['name']}`] = + payload.args.named[`${result.groups['name']}`] = stripQuotes( result.groups['value'] + ) } } else { unnamedArgs.push(argWord) - payload.args.unnamed[`arg${unnamedCount}`] = argWord + payload.args.unnamed[`arg${unnamedCount}`] = stripQuotes(argWord) unnamedCount += 1 } } diff --git a/src/main.ts b/src/main.ts index 9586a1736..f507cf0c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import * as github from '@actions/github' import {inspect} from 'util' import { getInputs, + tokeniseCommand, getCommandsConfig, configIsValid, actorHasPermission, @@ -60,17 +61,17 @@ async function run(): Promise { return } - // Split the first line into "words" - const commandWords = firstLine.slice(1).split(' ') - core.debug(`Command words: ${inspect(commandWords)}`) + // Tokenise the first line (minus the leading slash) + const commandTokens = tokeniseCommand(firstLine.slice(1)) + core.debug(`Command tokens: ${inspect(commandTokens)}`) // Check if the command is registered for dispatch let configMatches = config.filter(function (cmd) { - return cmd.command == commandWords[0] + return cmd.command == commandTokens[0] }) core.debug(`Config matches on 'command': ${inspect(configMatches)}`) if (configMatches.length == 0) { - core.info(`Command '${commandWords[0]}' is not registered for dispatch.`) + core.info(`Command '${commandTokens[0]}' is not registered for dispatch.`) return } @@ -87,7 +88,7 @@ async function run(): Promise { if (configMatches.length == 0) { const issueType = isPullRequest ? 'pull request' : 'issue' core.info( - `Command '${commandWords[0]}' is not configured for the issue type '${issueType}'.` + `Command '${commandTokens[0]}' is not configured for the issue type '${issueType}'.` ) return } @@ -100,7 +101,7 @@ async function run(): Promise { core.debug(`Config matches on 'allow_edits': ${inspect(configMatches)}`) if (configMatches.length == 0) { core.info( - `Command '${commandWords[0]}' is not configured to allow edits.` + `Command '${commandTokens[0]}' is not configured to allow edits.` ) return } @@ -133,13 +134,13 @@ async function run(): Promise { core.debug(`Config matches on 'permission': ${inspect(configMatches)}`) if (configMatches.length == 0) { core.info( - `Command '${commandWords[0]}' is not configured for the user's permission level '${actorPermission}'.` + `Command '${commandTokens[0]}' is not configured for the user's permission level '${actorPermission}'.` ) return } // Determined that the command should be dispatched - core.info(`Command '${commandWords[0]}' to be dispatched.`) + core.info(`Command '${commandTokens[0]}' to be dispatched.`) // Define payload const clientPayload: ClientPayload = { @@ -171,7 +172,7 @@ async function run(): Promise { for (const cmd of configMatches) { // Generate slash command payload clientPayload.slash_command = getSlashCommandPayload( - commandWords, + commandTokens, cmd.static_args ) core.debug( From 464b7e32c9229b8225ca20998759622c7fbce1b5 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 23 Jul 2020 11:04:37 +0900 Subject: [PATCH 22/33] Update documentation --- docs/updating.md | 55 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/docs/updating.md b/docs/updating.md index c8f769eb0..8735c99ba 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -4,25 +4,24 @@ - The format of the `slash_command` context has been changed to prevent an issue where named arguments can overwrite other properties of the payload. - The following is an example of the new `slash_command` context. The slash command `/deploy branch=master env=prod some other args` will be converted to a JSON payload as follows. + The following is an example of the new `slash_command` context. The slash command `/deploy branch=master smoke-test dry-run reason="new feature"` will be converted to a JSON payload as follows. ```json - "slash_command": { - "command": "deploy", - "args": { - "all": "branch=master env=prod some other args", - "unnamed": { - "all": "some other args", - "arg1": "some", - "arg2": "other", - "arg3": "args" - }, - "named": { - "branch": "master", - "env": "prod" - }, - } - } + "slash_command": { + "command": "deploy", + "args": { + "all": "branch=master smoke-test dry-run reason=\"new feature\"", + "unnamed": { + "all": "smoke-test dry-run", + "arg1": "smoke-test", + "arg2": "dry-run" + }, + "named": { + "branch": "master", + "reason": "new feature" + }, + } + } ``` - The `named-args` input (standard configuration) and `named_args` JSON property (advanced configuration) have been removed. Named arguments will now always be parsed and added to the `slash_command` context. @@ -31,15 +30,8 @@ ### New features -- The `commands` input can now be newline separated, or comma separated. - - e.g. - ```yml - commands: | - deploy - integration-test - build-docs - ``` +- Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. + There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](workflow-dispatch.md) for usage details. - Added a new input `static-args` (standard configuration), and a new JSON property `static_args` (advanced configuration). This is a list of arguments that will always be dispatched with commands. @@ -67,5 +59,12 @@ /send "hello world!" ``` -- Commands can now be dispatched via the new [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. For standard configuration, set the new `dispatch-type` input to `workflow`. For advanced configuration, set the `dispatch_type` JSON property of a command to `workflow`. - There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](workflow-dispatch.md) for usage details. +- The `commands` input can now be newline separated, or comma separated. + + e.g. + ```yml + commands: | + deploy + integration-test + build-docs + ``` From 192b73bf8050124680da6d75e873d013ed58ec81 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 23 Jul 2020 11:51:26 +0900 Subject: [PATCH 23/33] Update documentation --- docs/workflow-dispatch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index e56a01f33..d2b31337b 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -98,7 +98,7 @@ When creating the [workflow_dispatch](https://docs.github.com/en/actions/referen - `Required input '...' not provided` - A required input for the workflow was not supplied as a named argument. - `Unexpected inputs provided` - Named arguments were supplied that are not defined as workflow inputs. -The `error-message` output can be used to provide feedback to the user as follows. Note that the action step needs an `id` to access the outputs. +The `error-message` output can be used to provide feedback to the user as follows. Note that the action step needs an `id` to access outputs. ```yml - name: Slash Command Dispatch From 17a439d4d255af964f695fde82e944f5c1935621 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 23 Jul 2020 16:13:17 +0900 Subject: [PATCH 24/33] Update cpr to v3 --- .github/workflows/ci.yml | 4 +--- .github/workflows/update-dep.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8977acc4b..e9c1a3b69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,9 @@ jobs: name: dist path: dist - name: Create Pull Request - uses: peter-evans/create-pull-request@v2 + uses: peter-evans/create-pull-request@v3 with: commit-message: Update distribution - committer: GitHub - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> title: Update distribution body: | - Updates the distribution for changes on `master` diff --git a/.github/workflows/update-dep.yml b/.github/workflows/update-dep.yml index dacbde2d1..e59a80580 100644 --- a/.github/workflows/update-dep.yml +++ b/.github/workflows/update-dep.yml @@ -15,7 +15,7 @@ jobs: npx -p npm-check-updates ncu -u npm install - name: Create Pull Request - uses: peter-evans/create-pull-request@v2 + uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.ACTIONS_BOT_TOKEN }} commit-message: Update dependencies From 2296beb809f2eb56aef29bc8b83b5adc3319dbbc Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 09:25:31 +0900 Subject: [PATCH 25/33] Add a diff for the slash_command context change --- docs/updating.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/updating.md b/docs/updating.md index 8735c99ba..fa4cb9593 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -4,23 +4,29 @@ - The format of the `slash_command` context has been changed to prevent an issue where named arguments can overwrite other properties of the payload. - The following is an example of the new `slash_command` context. The slash command `/deploy branch=master smoke-test dry-run reason="new feature"` will be converted to a JSON payload as follows. + The following diff shows how the `slash_command` context has changed for the example command `/deploy branch=master smoke-test dry-run reason="new feature"`. - ```json + ```diff "slash_command": { "command": "deploy", - "args": { - "all": "branch=master smoke-test dry-run reason=\"new feature\"", - "unnamed": { - "all": "smoke-test dry-run", - "arg1": "smoke-test", - "arg2": "dry-run" - }, - "named": { - "branch": "master", - "reason": "new feature" - }, - } + - "args": "branch=master smoke-test dry-run reason=\"new feature\"", + - "unnamed_args": "smoke-test dry-run", + - "arg1": "smoke-test", + - "arg2": "dry-run" + - "branch": "master", + - "reason": "new feature" + + "args": { + + "all": "branch=master smoke-test dry-run reason=\"new feature\"", + + "unnamed": { + + "all": "smoke-test dry-run", + + "arg1": "smoke-test", + + "arg2": "dry-run" + + }, + + "named": { + + "branch": "master", + + "reason": "new feature" + + }, + + } } ``` From 9604e4dbf850076f73c85055851fb811ba44c65f Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 10:38:59 +0900 Subject: [PATCH 26/33] Add explanation of dispatch type differences --- README.md | 10 +++++++++- docs/workflow-dispatch.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 63c9ed90e..865c6f380 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,17 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c By default, the action creates [repository_dispatch](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. Setting `dispatch-type` to `workflow` will instead create [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. - There are significant differences in the action's behaviour when using `workflow` dispatch. See [workflow dispatch](docs/workflow-dispatch.md) for usage details. +For the majority of use cases, the default `repository` dispatch will likely be the most suitable for new workflows. +If you already have `workflow_dispatch` workflows, you can execute them with slash commands using this action. + +| Repository Dispatch (default) | Workflow Dispatch | +| --- | --- | +| Events are created with a `client_payload` giving the target workflow access to a wealth of useful [context properties](https://github.com/peter-evans/slash-command-dispatch/tree/dev#accessing-contexts). | A `client_payload` cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match named arguments supplied with the slash command. | +| Slash commands can only execute workflows in the target repository's default branch. | Slash commands can execute workflows in any branch using the `ref` named argument. The reference can be a branch, tag, or a commit SHA. | +| Immediate command validation feedback is unavailable when creating the dispatch event. | Immediate command [validation feedback](https://github.com/peter-evans/slash-command-dispatch/blob/dev/docs/workflow-dispatch.md#validation-errors) is available as an action output. | + ### How comments are parsed for slash commands Slash commands must be placed in the first line of the comment to be interpreted as a command. diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index d2b31337b..32376d7b0 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -11,7 +11,7 @@ There are significant differences in the action's behaviour when using `workflow - When issuing a slash command with arguments, *only named arguments are accepted*. Unnamed arguments will be ignored. - A maximum of 10 named arguments are accepted. Additional named arguments after the first 10 will be ignored. - `ref` is a reserved named argument that does not count towards the maximum of 10. This is used to specify the target reference of the command. The reference can be a branch, tag, or a commit SHA. If you omit the `ref` argument, the target repository's default branch will be used. -- A `client_payload` context cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match the named arguments supplied with the slash command. +- A `client_payload` context cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match named arguments supplied with the slash command. ## Handling dispatched commands From 296463be32e118778bbdf950d28c1a3263a5d2df Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 11:06:51 +0900 Subject: [PATCH 27/33] Disable eslint warnings for specific lines --- .eslintrc.json | 3 +-- src/github-helper.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 01d8ff980..799df884c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,7 +14,6 @@ ], "plugins": ["@typescript-eslint"], "rules": { - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/ban-types": "warn" + "@typescript-eslint/camelcase": "off" } } diff --git a/src/github-helper.ts b/src/github-helper.ts index 38e0519fa..a5d2d8d70 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -5,12 +5,16 @@ import {Command, SlashCommandPayload} from './command-helper' type ReposCreateDispatchEventParamsClientPayload = { [key: string]: ReposCreateDispatchEventParamsClientPayloadKeyString } +// eslint-disable-next-line type ReposCreateDispatchEventParamsClientPayloadKeyString = {} export interface ClientPayload extends ReposCreateDispatchEventParamsClientPayload { + // eslint-disable-next-line github: any + // eslint-disable-next-line pull_request?: any + // eslint-disable-next-line slash_command?: SlashCommandPayload | any } From 95b8faa4883d606624d38e70507a7e9f8ab2257b Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 11:07:43 +0900 Subject: [PATCH 28/33] Add handling for additional workflow dispatch errors --- dist/index.js | 6 +++++- docs/workflow-dispatch.md | 2 ++ src/main.ts | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index d8f430f70..7891726f5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -647,8 +647,12 @@ function run() { catch (error) { core.debug(util_1.inspect(error)); const message = error.message; + // Handle validation errors from workflow dispatch if (message == 'Unexpected inputs provided' || - (message.startsWith('Required input') && message.endsWith('not provided'))) { + (message.startsWith('Required input') && + message.endsWith('not provided')) || + message.startsWith('No ref found for:') || + message == `Workflow does not have 'workflow_dispatch' trigger`) { core.setOutput('error-message', message); core.warning(message); } diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index 32376d7b0..a35007502 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -97,6 +97,8 @@ When creating the [workflow_dispatch](https://docs.github.com/en/actions/referen - `Required input '...' not provided` - A required input for the workflow was not supplied as a named argument. - `Unexpected inputs provided` - Named arguments were supplied that are not defined as workflow inputs. +- `No ref found for: ...` - The supplied `ref` does not exist in the target repository. +- `Workflow does not have 'workflow_dispatch' trigger` - The target workflow doesn't define `on: workflow_dispatch`, OR, the supplied `ref` doesn't contain the target workflow. The `error-message` output can be used to provide feedback to the user as follows. Note that the action step needs an `id` to access outputs. diff --git a/src/main.ts b/src/main.ts index f507cf0c2..313c6d4ce 100644 --- a/src/main.ts +++ b/src/main.ts @@ -192,9 +192,13 @@ async function run(): Promise { } catch (error) { core.debug(inspect(error)) const message: string = error.message + // Handle validation errors from workflow dispatch if ( message == 'Unexpected inputs provided' || - (message.startsWith('Required input') && message.endsWith('not provided')) + (message.startsWith('Required input') && + message.endsWith('not provided')) || + message.startsWith('No ref found for:') || + message == `Workflow does not have 'workflow_dispatch' trigger` ) { core.setOutput('error-message', message) core.warning(message) From 1ae2a3c828e70d53440ed99b9abf14d803903ac1 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 11:20:55 +0900 Subject: [PATCH 29/33] Update documentation --- README.md | 16 ++++++++-------- docs/advanced-configuration.md | 10 +++++----- docs/examples.md | 28 ++++++++++++++-------------- docs/getting-started.md | 8 ++++---- docs/workflow-dispatch.md | 6 +++--- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 865c6f380..6eb359cf4 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ jobs: - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: | deploy integration-test @@ -69,8 +69,8 @@ This action also features [advanced configuration](docs/advanced-configuration.m | Input | Description | Default | | --- | --- | --- | -| `token` | (**required**) A `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](#token) for further details. | | -| `reaction-token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](#reaction-token) for further details. | `GITHUB_TOKEN` | +| `token` | (**required**) A `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](#token) for further details. | | +| `reaction-token` | `GITHUB_TOKEN` or a `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](#reaction-token) for further details. | `GITHUB_TOKEN` | | `reactions` | Add reactions. :eyes: = seen, :rocket: = dispatched | `true` | | `commands` | (**required**) A comma or newline separated list of commands. | | | `permission` | The repository permission level required by the user to dispatch commands. (`none`, `read`, `write`, `admin`) | `write` | @@ -99,8 +99,8 @@ You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/c - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} - reaction-token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} + reaction-token: ${{ secrets.PAT }} commands: | deploy integration-test @@ -162,7 +162,7 @@ To demonstrate, take the following configuration as an example. ```yml - uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: | deploy static-args: | @@ -232,7 +232,7 @@ The simplest response is to add a :tada: reaction to the comment. - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray @@ -248,7 +248,7 @@ Another option is to reply with a new comment containing a link to the run outpu - name: Create comment uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} issue-number: ${{ github.event.client_payload.github.payload.issue.number }} body: | diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index 01c1ece94..7fcb51620 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -10,7 +10,7 @@ For example, the following basic configuration means that all commands must have - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: | deploy integration-test @@ -40,7 +40,7 @@ jobs: - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} config: > [ { @@ -86,7 +86,7 @@ jobs: - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} config-from-file: .github/slash-command-dispatch.json ``` @@ -96,8 +96,8 @@ Advanced configuration requires a combination of yaml based inputs and JSON conf | Input | JSON Property | Description | Default | | --- | --- | --- | --- | -| `token` | | (**required**) A `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](https://github.com/peter-evans/slash-command-dispatch#token) for further details. | | -| `reaction-token` | | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](https://github.com/peter-evans/slash-command-dispatch#reaction-token) for further details. | `GITHUB_TOKEN` | +| `token` | | (**required**) A `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](https://github.com/peter-evans/slash-command-dispatch#token) for further details. | | +| `reaction-token` | | `GITHUB_TOKEN` or a `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](https://github.com/peter-evans/slash-command-dispatch#reaction-token) for further details. | `GITHUB_TOKEN` | | `reactions` | | Add reactions. :eyes: = seen, :rocket: = dispatched | `true` | | | `command` | (**required**) The slash command. | | | | `permission` | The repository permission level required by the user to dispatch the command. (`none`, `read`, `write`, `admin`) | `write` | diff --git a/docs/examples.md b/docs/examples.md index f05a76533..dafff566b 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -15,7 +15,7 @@ This is pattern for a slash command where a named argument specifies the branch /do-something branch=develop ``` -In the following command workflow, `REPO_ACCESS_TOKEN` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). +In the following command workflow, `PAT` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). ```yml name: do-something-command @@ -37,7 +37,7 @@ jobs: # Checkout the branch to test - uses: actions/checkout@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} ref: ${{ steps.vars.outputs.branch }} @@ -52,7 +52,7 @@ jobs: - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray @@ -88,7 +88,7 @@ jobs: # Checkout the branch to test - uses: actions/checkout@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} ref: ${{ steps.vars.outputs.branch }} @@ -113,7 +113,7 @@ jobs: - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray @@ -129,7 +129,7 @@ This is pattern for a slash command used in pull request comments. It checks out In the dispatch configuration for this command pattern, `issue-type` should be set to `pull-request`. This will prevent it from being dispatched from regular issue comments where it will fail. -In the following command workflow, `REPO_ACCESS_TOKEN` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). +In the following command workflow, `PAT` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). ```yml name: fix-pr-command @@ -143,7 +143,7 @@ jobs: # Checkout the pull request branch - uses: actions/checkout@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} ref: ${{ github.event.client_payload.pull_request.head.ref }} @@ -160,7 +160,7 @@ jobs: - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray @@ -189,7 +189,7 @@ jobs: - name: Checkout pull request uses: actions/checkout@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} ref: ${{ github.event.client_payload.pull_request.head.ref }} fetch-depth: 0 @@ -198,7 +198,7 @@ jobs: run: | git config --global user.name '${{ github.event.client_payload.github.actor }}' git config --global user.email '${{ github.event.client_payload.github.actor }}@users.noreply.github.com' - git remote add base https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/${{ github.event.client_payload.pull_request.base.repo.full_name }}.git + git remote add base https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.event.client_payload.pull_request.base.repo.full_name }}.git git fetch base ${{ github.event.client_payload.pull_request.base.ref }} git rebase base/${{ github.event.client_payload.pull_request.base.ref }} git push --force-with-lease @@ -206,7 +206,7 @@ jobs: - name: Update comment uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | @@ -220,7 +220,7 @@ jobs: - name: Update comment uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | @@ -250,7 +250,7 @@ jobs: # Checkout the pull request branch - uses: actions/checkout@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} ref: ${{ github.event.client_payload.pull_request.head.ref }} @@ -279,7 +279,7 @@ jobs: - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray diff --git a/docs/getting-started.md b/docs/getting-started.md index a4866f1eb..ca132e001 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -21,7 +21,7 @@ Follow this guide to get started with a working `/example` command. - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reaction-type: hooray @@ -31,7 +31,7 @@ Follow this guide to get started with a working `/example` command. 4. Go to your repository `Settings` -> `Secrets` and `Add a new secret`. - **Name**: `REPO_ACCESS_TOKEN` + **Name**: `PAT` **Value**: (The PAT created in step 3) @@ -58,7 +58,7 @@ Command processing setup is complete! Now we need to setup command dispatch for - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: example repository: your-github-username/slash-command-processor ``` @@ -67,7 +67,7 @@ Command processing setup is complete! Now we need to setup command dispatch for 3. Go to your repository `Settings` -> `Secrets` and `Add a new secret`. - **Name**: `REPO_ACCESS_TOKEN` + **Name**: `PAT` **Value**: (The PAT created in step 2) diff --git a/docs/workflow-dispatch.md b/docs/workflow-dispatch.md index a35007502..ee45a6807 100644 --- a/docs/workflow-dispatch.md +++ b/docs/workflow-dispatch.md @@ -36,7 +36,7 @@ jobs: - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: | deploy integration-test @@ -85,7 +85,7 @@ The simplest response is to add a :tada: reaction to the comment. - name: Add reaction uses: peter-evans/create-or-update-comment@v1 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} repository: ${{ github.event.inputs.repository }} comment-id: ${{ github.event.inputs.comment-id }} reaction-type: hooray @@ -107,7 +107,7 @@ The `error-message` output can be used to provide feedback to the user as follow id: scd uses: peter-evans/slash-command-dispatch@v2 with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} + token: ${{ secrets.PAT }} commands: | deploy integration-test From 31be627c12c19b23e01a37986d75d353af6e18a4 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 17:40:50 +0900 Subject: [PATCH 30/33] Update documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6eb359cf4..683db0694 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ In repositories with a lot of activity, the workflow queue will get backed up ve Dispatching commands to be processed elsewhere keeps the workflow queue moving quickly. It essentially enables parallel processing of workflows. +A additional benefit of dispatching is that it allows non-sensitive workloads to be run in public repositories to save using private repository Action minutes. +

## Demos From 0abbfd3eff90736b81064164d6f48b4835847bf6 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 17:52:49 +0900 Subject: [PATCH 31/33] Update documentation Co-authored-by: Markus Staab <47448731+clxmstaab@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 683db0694..65b0872f7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ In repositories with a lot of activity, the workflow queue will get backed up ve Dispatching commands to be processed elsewhere keeps the workflow queue moving quickly. It essentially enables parallel processing of workflows. -A additional benefit of dispatching is that it allows non-sensitive workloads to be run in public repositories to save using private repository Action minutes. +A additional benefit of dispatching is that it allows non-sensitive workloads to be run in public repositories to save using private repository GitHub Action minutes.
From 1b4c45c90a98cf22219ccdc5366b19d92378fcb8 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 24 Jul 2020 17:56:57 +0900 Subject: [PATCH 32/33] Update documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65b0872f7..7ef0bfd5a 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ If you already have `workflow_dispatch` workflows, you can execute them with sla | Repository Dispatch (default) | Workflow Dispatch | | --- | --- | | Events are created with a `client_payload` giving the target workflow access to a wealth of useful [context properties](https://github.com/peter-evans/slash-command-dispatch/tree/dev#accessing-contexts). | A `client_payload` cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match named arguments supplied with the slash command. | -| Slash commands can only execute workflows in the target repository's default branch. | Slash commands can execute workflows in any branch using the `ref` named argument. The reference can be a branch, tag, or a commit SHA. | +| Slash commands can only execute workflows in the target repository's default branch. | Slash commands can execute workflows in any branch using the `ref` named argument. The reference can be a branch, tag, or a commit SHA. This can be useful to test workflows in PR branches before merging. | | Immediate command validation feedback is unavailable when creating the dispatch event. | Immediate command [validation feedback](https://github.com/peter-evans/slash-command-dispatch/blob/dev/docs/workflow-dispatch.md#validation-errors) is available as an action output. | ### How comments are parsed for slash commands From 58e77ded38d151d93ec67ee807b33ea7285c1b51 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 25 Jul 2020 12:47:16 +0900 Subject: [PATCH 33/33] Update documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ef0bfd5a..bafe515b9 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,9 @@ If you already have `workflow_dispatch` workflows, you can execute them with sla | Repository Dispatch (default) | Workflow Dispatch | | --- | --- | -| Events are created with a `client_payload` giving the target workflow access to a wealth of useful [context properties](https://github.com/peter-evans/slash-command-dispatch/tree/dev#accessing-contexts). | A `client_payload` cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match named arguments supplied with the slash command. | +| Events are created with a `client_payload` giving the target workflow access to a wealth of useful [context properties](#accessing-contexts). | A `client_payload` cannot be sent with [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) events. The target workflow can only make use of up to 10 pre-defined inputs, the names of which must match named arguments supplied with the slash command. | | Slash commands can only execute workflows in the target repository's default branch. | Slash commands can execute workflows in any branch using the `ref` named argument. The reference can be a branch, tag, or a commit SHA. This can be useful to test workflows in PR branches before merging. | -| Immediate command validation feedback is unavailable when creating the dispatch event. | Immediate command [validation feedback](https://github.com/peter-evans/slash-command-dispatch/blob/dev/docs/workflow-dispatch.md#validation-errors) is available as an action output. | +| Immediate command validation feedback is unavailable when creating the dispatch event. | Immediate command [validation feedback](docs/workflow-dispatch.md#validation-errors) is available as an action output. | ### How comments are parsed for slash commands