diff --git a/README.md b/README.md index 410fd9d..78f1cb8 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ The IAM User that is used to run the action requires the following IAM permissio As a note to my future self, in order to work on this repo: * Clone it -* Run `npm install` to fetch dependencies +* Run `yarn install` to fetch dependencies * _hack hack hack_ * Run `npm run build` to update `dist/*`, which holds the files actually run * Read https://help.github.com/en/articles/creating-a-javascript-action if unsure. diff --git a/cli.js b/cli.js new file mode 100644 index 0000000..2fa448c --- /dev/null +++ b/cli.js @@ -0,0 +1,87 @@ +'use strict'; + +(async function () { + var core = require('@actions/core'); + core.setOutput = function () {}; + core.setFailed = function (message) { + console.log(message instanceof Error ? message.toString() : message); + process.exitCode = 1; + } + + const fs = require('fs'); + if (!fs.existsSync('./appspec.yml')) { + core.setFailed("❓ ./appspec.yml does not exist. Make sure you are in the project's top level directory."); + process.exit(); + } + + const simpleGit = require('simple-git'); + const git = simpleGit(); + var branchName, commitId; + + try { + await git.init(); + const remotes = await git.getRemotes(true); + var applicationName, fullRepositoryName; + + for (const remote of remotes) { + if (remote.name !== 'origin') { + continue; + } + + const url = remote.refs.push; + + var matches + + if (matches = url.match(/git@github.com:([a-z0-9_-]+)\/([a-z0-9_-]+).git/)) { + applicationName = matches[2]; + fullRepositoryName = `${matches[1]}/${matches[2]}`; + } + } + + branchName = await git.revparse(['--abbrev-ref', 'HEAD']); + commitId = await git.revparse(['HEAD']); + } catch (e) { + core.setFailed('🌩 Failed to parse git information. Are you sure this is a git repo?') + process.exit(); + } + + if (!applicationName || !fullRepositoryName) { + core.setFailed("❓ Unable to parse GitHub repository name from the 'origin' remote."); + process.exit(); + } + + console.log("🚂 OK, let's ship this..."); + console.log(`GitHub 💎 repository '${fullRepositoryName}'`); + console.log(`Branch 🎋 ${branchName}`); + console.log(`Commit ⚙️ ${commitId}`); + + const prompt = require('prompt'); + + prompt.message = ''; + prompt.start(); + + try { + await prompt.get({ + properties: { + confirm: { + name: 'yes', + message: 'Type "yes" to create deployment', + validator: /yes/, + warning: 'Must respond yes to continue', + default: '' + } + } + }); + } catch (e) { + core.setFailed('🙈 Aborted.'); + process.exit(); + } + + const action = require('./create-deployment'); + try { + await action.createDeployment(applicationName, fullRepositoryName, branchName, commitId, core); + } catch (e) { + console.log(`👉🏻 ${e.message}`); + process.exit(1); + } +})(); diff --git a/create-deployment.js b/create-deployment.js new file mode 100644 index 0000000..04a8c69 --- /dev/null +++ b/create-deployment.js @@ -0,0 +1,119 @@ +'use strict'; + +function fetchBranchConfig(branchName) { + const fs = require('fs'); + const yaml = require('js-yaml'); + + let fileContents = fs.readFileSync('./appspec.yml', 'utf8'); + let data = yaml.safeLoad(fileContents); + + for (var prop in data.branch_config) { + var regex = new RegExp('^' + prop + '$', 'i'); + if (branchName.match(regex)) { + if (data.branch_config[prop] == null) { + console.log(`🤷🏻‍♂️ Found an empty appspec.yml -> branch_config for '${branchName}' – skipping deployment`); + process.exit(); + } + console.log(`💡 Using appspec.yml -> branch_config '${prop}' for branch '${branchName}'`); + return data.branch_config[prop]; + } + } + + console.log(`❓ Found no matching appspec.yml -> branch_config for '${branchName}' – skipping deployment`); + process.exit(); +} + +exports.createDeployment = async function(applicationName, fullRepositoryName, branchName, commitId, core) { + const branchConfig = fetchBranchConfig(branchName); + const safeBranchName = branchName.replace(/[^a-z0-9-/]+/gi, '-').replace(/\/+/, '--'); + const deploymentGroupName = branchConfig.deploymentGroupName ? branchConfig.deploymentGroupName.replace('$BRANCH', safeBranchName) : safeBranchName; + const deploymentGroupConfig = branchConfig.deploymentGroupConfig; + const deploymentConfig = branchConfig.deploymentConfig; + + console.log(`🎳 Using deployment group '${deploymentGroupName}'`); + + const client = require('aws-sdk/clients/codedeploy'); + const codeDeploy = new client(); + + try { + await codeDeploy.updateDeploymentGroup({ + ...deploymentGroupConfig, + ...{ + applicationName: applicationName, + currentDeploymentGroupName: deploymentGroupName + } + }).promise(); + console.log(`⚙️ Updated deployment group '${deploymentGroupName}'`); + core.setOutput('deploymentGroupCreated', false); + } catch (e) { + if (e.code == 'DeploymentGroupDoesNotExistException') { + await codeDeploy.createDeploymentGroup({ + ...deploymentGroupConfig, + ...{ + applicationName: applicationName, + deploymentGroupName: deploymentGroupName, + } + }).promise(); + console.log(`🎯 Created deployment group '${deploymentGroupName}'`); + core.setOutput('deploymentGroupCreated', true); + } else { + core.setFailed(`🌩 Unhandled exception`); + throw e; + } + } + + let tries = 0; + while (true) { + + if (++tries > 5) { + core.setFailed('🤥 Unable to create a new deployment (too much concurrency?)'); + return; + } + + try { + var {deploymentId: deploymentId} = await codeDeploy.createDeployment({ + ...deploymentConfig, + ...{ + applicationName: applicationName, + deploymentGroupName: deploymentGroupName, + revision: { + revisionType: 'GitHub', + gitHubLocation: { + commitId: commitId, + repository: fullRepositoryName + } + } + } + }).promise(); + console.log(`🚚️ Created deployment ${deploymentId} – https://console.aws.amazon.com/codesuite/codedeploy/deployments/${deploymentId}?region=${codeDeploy.config.region}`); + core.setOutput('deploymentId', deploymentId); + core.setOutput('deploymentGroupName', deploymentGroupName); + break; + } catch (e) { + if (e.code == 'DeploymentLimitExceededException') { + var [, otherDeployment] = e.message.toString().match(/is already deploying deployment \'(d-\w+)\'/); + console.log(`😶 Waiting for another pending deployment ${otherDeployment}`); + try { + await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: otherDeployment}).promise(); + console.log(`🙂 The pending deployment ${otherDeployment} sucessfully finished.`); + } catch (e) { + console.log(`🤔 The other pending deployment ${otherDeployment} seems to have failed.`); + } + continue; + } else { + core.setFailed(`🌩 Unhandled exception`); + throw e; + } + } + } + + console.log(`⏲ Waiting for deployment ${deploymentId} to finish`); + + try { + await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: deploymentId}).promise(); + console.log('🥳 Deployment successful'); + } catch (e) { + core.setFailed(`😱 The deployment ${deploymentId} seems to have failed.`); + throw e; + } +} diff --git a/dist/index.js b/dist/index.js index 389fff1..4131986 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6132 +1,2526 @@ module.exports = -/******/ (function(modules, runtime) { // webpackBootstrap -/******/ "use strict"; -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ 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; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ __webpack_require__.ab = __dirname + "/"; -/******/ -/******/ // the startup function -/******/ function startup() { -/******/ // Load entry module and return exports -/******/ return __webpack_require__(104); -/******/ }; -/******/ -/******/ // run startup -/******/ return startup(); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const { requestLog } = __webpack_require__(916); -const { - restEndpointMethods -} = __webpack_require__(250); - -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]; - } -}); +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ -module.exports = Octokit; - - -/***/ }), -/* 1 */, -/* 2 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 9674: +/***/ ((module) => { "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; - +module.exports = JSON.parse("{\"name\":\"@octokit/rest\",\"version\":\"16.43.2\",\"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\":\"^4.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\":\"^6.0.0\",\"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\"}]}"); /***/ }), -/* 3 */, -/* 4 */, -/* 5 */, -/* 6 */, -/* 7 */, -/* 8 */, -/* 9 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + +/***/ 9013: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; +function fetchBranchConfig(branchName) { + const fs = __webpack_require__(5747); + const yaml = __webpack_require__(1917); -var loader = __webpack_require__(457); -var dumper = __webpack_require__(685); + let fileContents = fs.readFileSync('./appspec.yml', 'utf8'); + let data = yaml.safeLoad(fileContents); + for (var prop in data.branch_config) { + var regex = new RegExp('^' + prop + '$', 'i'); + if (branchName.match(regex)) { + if (data.branch_config[prop] == null) { + console.log(`🤷🏻‍♂️ Found an empty appspec.yml -> branch_config for '${branchName}' – skipping deployment`); + process.exit(); + } + console.log(`💡 Using appspec.yml -> branch_config '${prop}' for branch '${branchName}'`); + return data.branch_config[prop]; + } + } -function deprecated(name) { - return function () { - throw new Error('Function ' + name + ' is deprecated and cannot be used.'); - }; + console.log(`❓ Found no matching appspec.yml -> branch_config for '${branchName}' – skipping deployment`); + process.exit(); } +exports.createDeployment = async function(applicationName, fullRepositoryName, branchName, commitId, core) { + const branchConfig = fetchBranchConfig(branchName); + const safeBranchName = branchName.replace(/[^a-z0-9-/]+/gi, '-').replace(/\/+/, '--'); + const deploymentGroupName = branchConfig.deploymentGroupName ? branchConfig.deploymentGroupName.replace('$BRANCH', safeBranchName) : safeBranchName; + const deploymentGroupConfig = branchConfig.deploymentGroupConfig; + const deploymentConfig = branchConfig.deploymentConfig; -module.exports.Type = __webpack_require__(945); -module.exports.Schema = __webpack_require__(43); -module.exports.FAILSAFE_SCHEMA = __webpack_require__(581); -module.exports.JSON_SCHEMA = __webpack_require__(23); -module.exports.CORE_SCHEMA = __webpack_require__(611); -module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(723); -module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(910); -module.exports.load = loader.load; -module.exports.loadAll = loader.loadAll; -module.exports.safeLoad = loader.safeLoad; -module.exports.safeLoadAll = loader.safeLoadAll; -module.exports.dump = dumper.dump; -module.exports.safeDump = dumper.safeDump; -module.exports.YAMLException = __webpack_require__(556); - -// Deprecated schema names from JS-YAML 2.0.x -module.exports.MINIMAL_SCHEMA = __webpack_require__(581); -module.exports.SAFE_SCHEMA = __webpack_require__(723); -module.exports.DEFAULT_SCHEMA = __webpack_require__(910); - -// Deprecated functions from JS-YAML 1.x.x -module.exports.scan = deprecated('scan'); -module.exports.parse = deprecated('parse'); -module.exports.compose = deprecated('compose'); -module.exports.addConstructor = deprecated('addConstructor'); + console.log(`🎳 Using deployment group '${deploymentGroupName}'`); + const client = __webpack_require__(4599); + const codeDeploy = new client(); -/***/ }), -/* 10 */, -/* 11 */ -/***/ (function(module) { + try { + await codeDeploy.updateDeploymentGroup({ + ...deploymentGroupConfig, + ...{ + applicationName: applicationName, + currentDeploymentGroupName: deploymentGroupName + } + }).promise(); + console.log(`⚙️ Updated deployment group '${deploymentGroupName}'`); + core.setOutput('deploymentGroupCreated', false); + } catch (e) { + if (e.code == 'DeploymentGroupDoesNotExistException') { + await codeDeploy.createDeploymentGroup({ + ...deploymentGroupConfig, + ...{ + applicationName: applicationName, + deploymentGroupName: deploymentGroupName, + } + }).promise(); + console.log(`🎯 Created deployment group '${deploymentGroupName}'`); + core.setOutput('deploymentGroupCreated', true); + } else { + core.setFailed(`🌩 Unhandled exception`); + throw e; + } + } -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) + let tries = 0; + while (true) { - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') + if (++tries > 5) { + core.setFailed('🤥 Unable to create a new deployment (too much concurrency?)'); + return; + } - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) + try { + var {deploymentId: deploymentId} = await codeDeploy.createDeployment({ + ...deploymentConfig, + ...{ + applicationName: applicationName, + deploymentGroupName: deploymentGroupName, + revision: { + revisionType: 'GitHub', + gitHubLocation: { + commitId: commitId, + repository: fullRepositoryName + } + } + } + }).promise(); + console.log(`🚚️ Created deployment ${deploymentId} – https://console.aws.amazon.com/codesuite/codedeploy/deployments/${deploymentId}?region=${codeDeploy.config.region}`); + core.setOutput('deploymentId', deploymentId); + core.setOutput('deploymentGroupName', deploymentGroupName); + break; + } catch (e) { + if (e.code == 'DeploymentLimitExceededException') { + var [, otherDeployment] = e.message.toString().match(/is already deploying deployment \'(d-\w+)\'/); + console.log(`😶 Waiting for another pending deployment ${otherDeployment}`); + try { + await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: otherDeployment}).promise(); + console.log(`🙂 The pending deployment ${otherDeployment} sucessfully finished.`); + } catch (e) { + console.log(`🤔 The other pending deployment ${otherDeployment} seems to have failed.`); + } + continue; + } else { + core.setFailed(`🌩 Unhandled exception`); + throw e; + } + } + } - return wrapper + console.log(`⏲ Waiting for deployment ${deploymentId} to finish`); - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) + try { + await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: deploymentId}).promise(); + console.log('🥳 Deployment successful'); + } catch (e) { + core.setFailed(`😱 The deployment ${deploymentId} seems to have failed.`); + throw e; } - return ret - } } /***/ }), -/* 12 */, -/* 13 */, -/* 14 */, -/* 15 */, -/* 16 */ -/***/ (function(module) { - -module.exports = require("tls"); - -/***/ }), -/* 17 */, -/* 18 */ -/***/ (function(module) { - -module.exports = eval("require")("encoding"); +/***/ 2932: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -/***/ }), -/* 19 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +"use strict"; -module.exports = authenticationPlugin; -const { Deprecation } = __webpack_require__(692); -const once = __webpack_require__(969); +(async function () { + const core = __webpack_require__(2186); + const github = __webpack_require__(5438); + const payload = github.context.payload; + const action = __webpack_require__(9013); -const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation)); + const applicationName = core.getInput('application') || payload.repository.name; // like "Hello-World" + const fullRepositoryName = payload.repository.full_name; // like "Codertocat/Hello-World" -const authenticate = __webpack_require__(674); -const beforeRequest = __webpack_require__(471); -const requestError = __webpack_require__(349); + const isPullRequest = payload.pull_request !== undefined; + const commitId = isPullRequest ? payload.pull_request.head.sha : payload.head_commit.id; // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821" + const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); // like "my/branch_name" + console.log(`🎋 On branch '${branchName}', head commit ${commitId}`); -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; - } - 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)); -} + try { + action.createDeployment(applicationName, fullRepositoryName, branchName, commitId, core); + } catch (e) {} +})(); /***/ }), -/* 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); +/***/ 7351: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // 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); +"use strict"; - return spawned; +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__(2087)); +/** + * 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 -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); +/***/ 2186: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // 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); +"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__(7351); +const os = __importStar(__webpack_require__(2087)); +const path = __importStar(__webpack_require__(5622)); +/** + * 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); } - -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; - - -/***/ }), -/* 21 */, -/* 22 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { - -var AWS = __webpack_require__(395); -var STS = __webpack_require__(106); -var iniLoader = AWS.util.iniLoader; - +exports.exportVariable = exportVariable; /** - * Represents credentials loaded from shared credentials file - * (defaulting to ~/.aws/credentials or defined by the - * `AWS_SHARED_CREDENTIALS_FILE` environment variable). - * - * ## Using the shared credentials file - * - * This provider is checked by default in the Node.js environment. To use the - * credentials file provider, simply add your access and secret keys to the - * ~/.aws/credentials file in the following format: - * - * [default] - * aws_access_key_id = AKID... - * aws_secret_access_key = YOUR_SECRET_KEY - * - * ## Using custom profiles - * - * The SDK supports loading credentials for separate profiles. This can be done - * in two ways: - * - * 1. Set the `AWS_PROFILE` environment variable in your process prior to - * loading the SDK. - * 2. Directly load the AWS.SharedIniFileCredentials provider: + * 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. * - * ```javascript - * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); - * AWS.config.credentials = creds; - * ``` + * @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. * - * @!macro nobrowser + * @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 */ -AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * Creates a new SharedIniFileCredentials object. - * - * @param options [map] a set of options - * @option options profile [String] (AWS_PROFILE env var or 'default') - * the name of the profile to load. - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var) - * the filename to use when loading credentials. - * @option options disableAssumeRole [Boolean] (false) True to disable - * support for profiles that assume an IAM role. If true, and an assume - * role profile is selected, an error is raised. - * @option options preferStaticCredentials [Boolean] (false) True to - * prefer static credentials to role_arn if both are present. - * @option options tokenCodeFn [Function] (null) Function to provide - * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini - * file. Function is called with value of mfa_serial and callback, and - * should provide the TokenCode or an error to the callback in the format - * callback(err, token) - * @option options callback [Function] (err) Credentials are eagerly loaded - * by the constructor. When the callback is called with no error, the - * credentials have been loaded successfully. - * @option options httpOptions [map] A set of options to pass to the low-level - * HTTP request. Currently supported options are: - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Defaults to the global - * agent (`http.globalAgent`) for non-SSL connections. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only available in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — Sets the socket to timeout after timeout - * milliseconds of inactivity on the socket. Defaults to two minutes - * (120000). - */ - constructor: function SharedIniFileCredentials(options) { - AWS.Credentials.call(this); +// 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 - options = options || {}; +/***/ }), - this.filename = options.filename; - this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.disableAssumeRole = Boolean(options.disableAssumeRole); - this.preferStaticCredentials = Boolean(options.preferStaticCredentials); - this.tokenCodeFn = options.tokenCodeFn || null; - this.httpOptions = options.httpOptions || null; - this.get(options.callback || AWS.util.fn.noop); - }, +/***/ 4087: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - /** - * @api private - */ - load: function load(callback) { - var self = this; - try { - var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); - var profile = profiles[this.profile] || {}; +"use strict"; - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' not found'), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fs_1 = __webpack_require__(5747); +const os_1 = __webpack_require__(2087); +class Context { + /** + * Hydrate the context from the environment + */ + constructor() { + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) { + if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { + this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); + } + else { + const path = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); + } + } + this.eventName = process.env.GITHUB_EVENT_NAME; + this.sha = process.env.GITHUB_SHA; + this.ref = process.env.GITHUB_REF; + this.workflow = process.env.GITHUB_WORKFLOW; + this.action = process.env.GITHUB_ACTION; + this.actor = process.env.GITHUB_ACTOR; + } + get issue() { + const payload = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); + } + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); + return { owner, repo }; + } + if (this.payload.repository) { + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name + }; + } + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + } +} +exports.Context = Context; +//# sourceMappingURL=context.js.map - /* - In the CLI, the presence of both a role_arn and static credentials have - different meanings depending on how many profiles have been visited. For - the first profile processed, role_arn takes precedence over any static - credentials, but for all subsequent profiles, static credentials are - used if present, and only in their absence will the profile's - source_profile and role_arn keys be used to load another set of - credentials. This var is intended to yield compatible behaviour in this - sdk. - */ - var preferStaticCredentialsToRoleArn = Boolean( - this.preferStaticCredentials - && profile['aws_access_key_id'] - && profile['aws_secret_access_key'] - ); +/***/ }), - if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { - this.loadRoleProfile(profiles, profile, function(err, data) { - if (err) { - callback(err); - } else { - self.expired = false; - self.accessKeyId = data.Credentials.AccessKeyId; - self.secretAccessKey = data.Credentials.SecretAccessKey; - self.sessionToken = data.Credentials.SessionToken; - self.expireTime = data.Credentials.Expiration; - callback(null); - } - }); - return; - } +/***/ 5438: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - this.accessKeyId = profile['aws_access_key_id']; - this.secretAccessKey = profile['aws_secret_access_key']; - this.sessionToken = profile['aws_session_token']; +"use strict"; - if (!this.accessKeyId || !this.secretAccessKey) { - throw AWS.util.error( - new Error('Credentials not set for profile ' + this.profile), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); - } - this.expired = false; - callback(null); - } catch (err) { - callback(err); +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__(8467); +const rest_1 = __webpack_require__(9351); +const Context = __importStar(__webpack_require__(4087)); +const httpClient = __importStar(__webpack_require__(9925)); +// 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)); } - }, - - /** - * Loads the credentials from the shared credentials file - * - * @callback callback function(err) - * Called after the shared INI file on disk is read and parsed. When this - * callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - iniLoader.clearCachedFiles(); - this.coalesceRefresh( - callback || AWS.util.fn.callback, - this.disableAssumeRole - ); - }, - - /** - * @api private - */ - loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { - if (this.disableAssumeRole) { - throw AWS.util.error( - new Error('Role assumption profiles are disabled. ' + - 'Failed to load profile ' + this.profile + - ' from ' + creds.filename), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + /** + * Disambiguates the constructor overload parameters + */ + static disambiguate(token, opts) { + return [ + typeof token === 'string' ? token : '', + typeof token === 'object' ? token : opts || {} + ]; } - - var self = this; - var roleArn = roleProfile['role_arn']; - var roleSessionName = roleProfile['role_session_name']; - var externalId = roleProfile['external_id']; - var mfaSerial = roleProfile['mfa_serial']; - var sourceProfileName = roleProfile['source_profile']; - - if (!sourceProfileName) { - throw AWS.util.error( - new Error('source_profile is not set using profile ' + this.profile), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + static getOctokitOptions(args) { + const token = args[0]; + const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller + // Base URL - GHES or Dotcom + options.baseUrl = options.baseUrl || this.getApiBaseUrl(); + // Auth + const auth = GitHub.getAuthString(token, options); + if (auth) { + options.auth = auth; + } + // Proxy + const agent = GitHub.getProxyAgent(options.baseUrl, 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; } - - var sourceProfileExistanceTest = creds[sourceProfileName]; - - if (typeof sourceProfileExistanceTest !== 'object') { - throw AWS.util.error( - new Error('source_profile ' + sourceProfileName + ' using profile ' - + this.profile + ' does not exist'), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + static getGraphQL(args) { + const defaults = {}; + defaults.baseUrl = this.getGraphQLBaseUrl(); + 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(defaults.baseUrl, options); + if (agent) { + defaults.request = { agent }; + } + return graphql_1.graphql.defaults(defaults); } - - var sourceCredentials = new AWS.SharedIniFileCredentials( - AWS.util.merge(this.options || {}, { - profile: sourceProfileName, - preferStaticCredentials: true - }) - ); - - this.roleArn = roleArn; - var sts = new STS({ - credentials: sourceCredentials, - httpOptions: this.httpOptions - }); - - var roleParams = { - RoleArn: roleArn, - RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() - }; - - if (externalId) { - roleParams.ExternalId = externalId; + 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}`; } - - if (mfaSerial && self.tokenCodeFn) { - roleParams.SerialNumber = mfaSerial; - self.tokenCodeFn(mfaSerial, function(err, token) { - if (err) { - var message; - if (err instanceof Error) { - message = err.message; - } else { - message = err; - } - callback( - AWS.util.error( - new Error('Error fetching MFA token: ' + message), - { code: 'SharedIniFileCredentialsProviderFailure' } - )); - return; + static getProxyAgent(destinationUrl, options) { + var _a; + if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) { + if (httpClient.getProxyUrl(destinationUrl)) { + const hc = new httpClient.HttpClient(); + return hc.getAgent(destinationUrl); + } } - - roleParams.TokenCode = token; - sts.assumeRole(roleParams, callback); - }); - return; + return undefined; } - sts.assumeRole(roleParams, callback); - } -}); - - -/***/ }), -/* 23 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - - - - -var Schema = __webpack_require__(43); - - -module.exports = new Schema({ - include: [ - __webpack_require__(581) - ], - implicit: [ - __webpack_require__(809), - __webpack_require__(228), - __webpack_require__(44), - __webpack_require__(417) - ] -}); - + static getApiBaseUrl() { + return process.env['GITHUB_API_URL'] || 'https://api.github.com'; + } + static getGraphQLBaseUrl() { + let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql'; + // Shouldn't be a trailing slash, but remove if so + if (url.endsWith('/')) { + url = url.substr(0, url.length - 1); + } + // Remove trailing "/graphql" + if (url.toUpperCase().endsWith('/GRAPHQL')) { + url = url.substr(0, url.length - '/graphql'.length); + } + return url; + } +} +exports.GitHub = GitHub; +//# sourceMappingURL=github.js.map /***/ }), -/* 24 */, -/* 25 */, -/* 26 */, -/* 27 */, -/* 28 */, -/* 29 */, -/* 30 */, -/* 31 */, -/* 32 */, -/* 33 */, -/* 34 */, -/* 35 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -// Generated by CoffeeScript 1.12.7 -(function() { - var XMLCData, XMLNode, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; +/***/ 9925: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - XMLNode = __webpack_require__(327); +"use strict"; - module.exports = XMLCData = (function(superClass) { - extend(XMLCData, superClass); - - function XMLCData(parent, text) { - XMLCData.__super__.constructor.call(this, parent); - if (text == null) { - throw new Error("Missing CDATA text"); - } - this.text = this.stringify.cdata(text); - } - - XMLCData.prototype.clone = function() { - return Object.create(this); - }; - - XMLCData.prototype.toString = function(options) { - return this.options.writer.set(options).cdata(this); - }; - - return XMLCData; - - })(XMLNode); - -}).call(this); - - -/***/ }), -/* 36 */, -/* 37 */, -/* 38 */, -/* 39 */ -/***/ (function(module) { - -"use strict"; - -module.exports = opts => { - opts = opts || {}; - - const env = opts.env || process.env; - const platform = opts.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; -}; - - -/***/ }), -/* 40 */, -/* 41 */, -/* 42 */, -/* 43 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -/*eslint-disable max-len*/ - -var common = __webpack_require__(740); -var YAMLException = __webpack_require__(556); -var Type = __webpack_require__(945); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const url = __webpack_require__(8835); +const http = __webpack_require__(8605); +const https = __webpack_require__(7211); +const pm = __webpack_require__(6443); +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 : ''; } - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); +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()); + }); + }); } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - - -/***/ }), -/* 44 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -var common = __webpack_require__(740); -var Type = __webpack_require__(945); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); } - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = url.parse(requestUrl); + return parsedUrl.protocol === 'https:'; } - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; +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; + } + } } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); - - -/***/ }), -/* 45 */, -/* 46 */, -/* 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; -} - - -/***/ }), -/* 48 */, -/* 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('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || ''; - } catch (_) { - stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || ''; - } - - const year = (stdout.match(/2008|2012|2016|2019/) || [])[0]; - - if (year) { - return `Server ${year}`; - } - } - - return names.get(ver); -}; - -module.exports = windowsRelease; + 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__(4294); + } + 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; /***/ }), -/* 50 */, -/* 51 */, -/* 52 */, -/* 53 */, -/* 54 */, -/* 55 */, -/* 56 */ -/***/ (function(module) { -module.exports = {"version":"2.0","metadata":{"apiVersion":"2014-06-30","endpointPrefix":"cognito-identity","jsonVersion":"1.1","protocol":"json","serviceFullName":"Amazon Cognito Identity","serviceId":"Cognito Identity","signatureVersion":"v4","targetPrefix":"AWSCognitoIdentityService","uid":"cognito-identity-2014-06-30"},"operations":{"CreateIdentityPool":{"input":{"type":"structure","required":["IdentityPoolName","AllowUnauthenticatedIdentities"],"members":{"IdentityPoolName":{},"AllowUnauthenticatedIdentities":{"type":"boolean"},"AllowClassicFlow":{"type":"boolean"},"SupportedLoginProviders":{"shape":"S5"},"DeveloperProviderName":{},"OpenIdConnectProviderARNs":{"shape":"S9"},"CognitoIdentityProviders":{"shape":"Sb"},"SamlProviderARNs":{"shape":"Sg"},"IdentityPoolTags":{"shape":"Sh"}}},"output":{"shape":"Sk"}},"DeleteIdentities":{"input":{"type":"structure","required":["IdentityIdsToDelete"],"members":{"IdentityIdsToDelete":{"type":"list","member":{}}}},"output":{"type":"structure","members":{"UnprocessedIdentityIds":{"type":"list","member":{"type":"structure","members":{"IdentityId":{},"ErrorCode":{}}}}}}},"DeleteIdentityPool":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}}},"DescribeIdentity":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{}}},"output":{"shape":"Sv"}},"DescribeIdentityPool":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}},"output":{"shape":"Sk"}},"GetCredentialsForIdentity":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{},"Logins":{"shape":"S10"},"CustomRoleArn":{}}},"output":{"type":"structure","members":{"IdentityId":{},"Credentials":{"type":"structure","members":{"AccessKeyId":{},"SecretKey":{},"SessionToken":{},"Expiration":{"type":"timestamp"}}}}}},"GetId":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"AccountId":{},"IdentityPoolId":{},"Logins":{"shape":"S10"}}},"output":{"type":"structure","members":{"IdentityId":{}}}},"GetIdentityPoolRoles":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"Roles":{"shape":"S1c"},"RoleMappings":{"shape":"S1e"}}}},"GetOpenIdToken":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{},"Logins":{"shape":"S10"}}},"output":{"type":"structure","members":{"IdentityId":{},"Token":{}}}},"GetOpenIdTokenForDeveloperIdentity":{"input":{"type":"structure","required":["IdentityPoolId","Logins"],"members":{"IdentityPoolId":{},"IdentityId":{},"Logins":{"shape":"S10"},"TokenDuration":{"type":"long"}}},"output":{"type":"structure","members":{"IdentityId":{},"Token":{}}}},"ListIdentities":{"input":{"type":"structure","required":["IdentityPoolId","MaxResults"],"members":{"IdentityPoolId":{},"MaxResults":{"type":"integer"},"NextToken":{},"HideDisabled":{"type":"boolean"}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"Identities":{"type":"list","member":{"shape":"Sv"}},"NextToken":{}}}},"ListIdentityPools":{"input":{"type":"structure","required":["MaxResults"],"members":{"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"IdentityPools":{"type":"list","member":{"type":"structure","members":{"IdentityPoolId":{},"IdentityPoolName":{}}}},"NextToken":{}}}},"ListTagsForResource":{"input":{"type":"structure","required":["ResourceArn"],"members":{"ResourceArn":{}}},"output":{"type":"structure","members":{"Tags":{"shape":"Sh"}}}},"LookupDeveloperIdentity":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{},"IdentityId":{},"DeveloperUserIdentifier":{},"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"IdentityId":{},"DeveloperUserIdentifierList":{"type":"list","member":{}},"NextToken":{}}}},"MergeDeveloperIdentities":{"input":{"type":"structure","required":["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],"members":{"SourceUserIdentifier":{},"DestinationUserIdentifier":{},"DeveloperProviderName":{},"IdentityPoolId":{}}},"output":{"type":"structure","members":{"IdentityId":{}}}},"SetIdentityPoolRoles":{"input":{"type":"structure","required":["IdentityPoolId","Roles"],"members":{"IdentityPoolId":{},"Roles":{"shape":"S1c"},"RoleMappings":{"shape":"S1e"}}}},"TagResource":{"input":{"type":"structure","required":["ResourceArn","Tags"],"members":{"ResourceArn":{},"Tags":{"shape":"Sh"}}},"output":{"type":"structure","members":{}}},"UnlinkDeveloperIdentity":{"input":{"type":"structure","required":["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],"members":{"IdentityId":{},"IdentityPoolId":{},"DeveloperProviderName":{},"DeveloperUserIdentifier":{}}}},"UnlinkIdentity":{"input":{"type":"structure","required":["IdentityId","Logins","LoginsToRemove"],"members":{"IdentityId":{},"Logins":{"shape":"S10"},"LoginsToRemove":{"shape":"Sw"}}}},"UntagResource":{"input":{"type":"structure","required":["ResourceArn","TagKeys"],"members":{"ResourceArn":{},"TagKeys":{"type":"list","member":{}}}},"output":{"type":"structure","members":{}}},"UpdateIdentityPool":{"input":{"shape":"Sk"},"output":{"shape":"Sk"}}},"shapes":{"S5":{"type":"map","key":{},"value":{}},"S9":{"type":"list","member":{}},"Sb":{"type":"list","member":{"type":"structure","members":{"ProviderName":{},"ClientId":{},"ServerSideTokenCheck":{"type":"boolean"}}}},"Sg":{"type":"list","member":{}},"Sh":{"type":"map","key":{},"value":{}},"Sk":{"type":"structure","required":["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],"members":{"IdentityPoolId":{},"IdentityPoolName":{},"AllowUnauthenticatedIdentities":{"type":"boolean"},"AllowClassicFlow":{"type":"boolean"},"SupportedLoginProviders":{"shape":"S5"},"DeveloperProviderName":{},"OpenIdConnectProviderARNs":{"shape":"S9"},"CognitoIdentityProviders":{"shape":"Sb"},"SamlProviderARNs":{"shape":"Sg"},"IdentityPoolTags":{"shape":"Sh"}}},"Sv":{"type":"structure","members":{"IdentityId":{},"Logins":{"shape":"Sw"},"CreationDate":{"type":"timestamp"},"LastModifiedDate":{"type":"timestamp"}}},"Sw":{"type":"list","member":{}},"S10":{"type":"map","key":{},"value":{}},"S1c":{"type":"map","key":{},"value":{}},"S1e":{"type":"map","key":{},"value":{"type":"structure","required":["Type"],"members":{"Type":{},"AmbiguousRoleResolution":{},"RulesConfiguration":{"type":"structure","required":["Rules"],"members":{"Rules":{"type":"list","member":{"type":"structure","required":["Claim","MatchType","Value","RoleARN"],"members":{"Claim":{},"MatchType":{},"Value":{},"RoleARN":{}}}}}}}}}}}; +/***/ 6443: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const url = __webpack_require__(8835); +function getProxyUrl(reqUrl) { + let usingSsl = reqUrl.protocol === 'https:'; + let proxyUrl; + if (checkBypass(reqUrl)) { + return proxyUrl; + } + let proxyVar; + if (usingSsl) { + proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + if (proxyVar) { + proxyUrl = url.parse(proxyVar); + } + return proxyUrl; +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (let upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; + /***/ }), -/* 57 */, -/* 58 */, -/* 59 */, -/* 60 */, -/* 61 */, -/* 62 */, -/* 63 */, -/* 64 */, -/* 65 */, -/* 66 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { -var AWS = __webpack_require__(395); +/***/ 334: +/***/ ((__unused_webpack_module, exports) => { -var inherit = AWS.util.inherit; +"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 + }; +} /** - * @api private + * Prefix token for usage in the Authorization header + * + * @param token OAuth token or JSON Web Token */ -AWS.Signers.RequestSigner = inherit({ - constructor: function RequestSigner(request) { - this.request = request; - }, +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } - setServiceClientId: function setServiceClientId(id) { - this.serviceClientId = id; - }, + return `token ${token}`; +} - getServiceClientId: function getServiceClientId() { - return this.serviceClientId; +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"); } -}); -AWS.Signers.RequestSigner.getVersion = function getVersion(version) { - switch (version) { - case 'v2': return AWS.Signers.V2; - case 'v3': return AWS.Signers.V3; - case 's3v4': return AWS.Signers.V4; - case 'v4': return AWS.Signers.V4; - case 's3': return AWS.Signers.S3; - case 'v3https': return AWS.Signers.V3Https; + if (typeof token !== "string") { + throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); } - throw new Error('Unknown signing version ' + version); + + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); }; -__webpack_require__(220); -__webpack_require__(791); -__webpack_require__(566); -__webpack_require__(754); -__webpack_require__(616); -__webpack_require__(951); - - -/***/ }), -/* 67 */, -/* 68 */, -/* 69 */, -/* 70 */, -/* 71 */, -/* 72 */, -/* 73 */, -/* 74 */, -/* 75 */, -/* 76 */, -/* 77 */, -/* 78 */, -/* 79 */, -/* 80 */, -/* 81 */, -/* 82 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map -"use strict"; +/***/ }), -var Type = __webpack_require__(945); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day +/***/ 9440: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute +"use strict"; -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; +Object.defineProperty(exports, "__esModule", ({ value: true })); - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); +var isPlainObject = __webpack_require__(3287); +var universalUserAgent = __webpack_require__(5030); - if (match === null) throw new Error('Date resolve error'); +function lowercaseKeys(object) { + if (!object) { + return {}; + } - // match: [1] year [2] month [3] day + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach(key => { + if (isPlainObject.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; +} - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } +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 - // match: [4] hour [5] minute [6] second [7] fraction - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); + options.headers = lowercaseKeys(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); } - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (names.length === 0) { + return url; + } - if (delta) date.setTime(date.getTime() - delta); + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } - return date; + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); } -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); +const urlVariableRegex = /\{[^}]+\}/g; + +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); } -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + if (!matches) { + return []; + } -/***/ }), -/* 83 */, -/* 84 */, -/* 85 */, -/* 86 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} -var rng = __webpack_require__(139); -var bytesToUuid = __webpack_require__(722); +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); +} -// **`v1()` - Generate time-based UUID** +// Based on https://github.com/bramstein/url-template, licensed under BSD +// TODO: create separate package. // -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -var _nodeId; -var _clockseq; - -// Previous uuid creation time -var _lastMSecs = 0; -var _lastNSecs = 0; - -// See https://github.com/broofa/node-uuid for API details -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; +// 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. - // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - if (node == null || clockseq == null) { - var seedBytes = rng(); - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [ - seedBytes[0] | 0x01, - seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] - ]; - } - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; +/* 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, "]"); } - } - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + return part; + }).join(""); +} - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; } +} - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; +function isDefined(value) { + return value !== undefined && value !== null; +} - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; + 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 = []; - // `clock_seq_low` - b[i++] = clockseq & 0xff; + 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())); + } + }); + } - // `node` - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; + 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(""); + } } - return buf ? buf : bytesToUuid(b); + return result; } -module.exports = v1; - +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; +} -/***/ }), -/* 87 */ -/***/ (function(module) { +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; -module.exports = require("os"); + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } -/***/ }), -/* 88 */, -/* 89 */, -/* 90 */, -/* 91 */, -/* 92 */, -/* 93 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); -"use strict"; + 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); + } + }); +} -var common = __webpack_require__(740); +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible + 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 -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; + const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - if (!this.buffer) return null; + if (!isBinaryRequest) { + 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(","); + } - indent = indent || 4; - maxLength = maxLength || 75; + 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 - head = ''; - start = this.position; - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; + 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 - tail = ''; - end = this.position; - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } + 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 - snippet = this.buffer.slice(start, end); - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); +} - if (this.name) { - where += 'in "' + this.name + '" '; - } +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); +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 + }); +} - if (!compact) { - snippet = this.getSnippet(); +const VERSION = "6.0.6"; - if (snippet) { - where += ':\n' + snippet; - } - } +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. - return where; +const DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "", + previews: [] + } }; +const endpoint = withDefaults(null, DEFAULTS); -module.exports = Mark; +exports.endpoint = endpoint; +//# sourceMappingURL=index.js.map /***/ }), -/* 94 */, -/* 95 */, -/* 96 */, -/* 97 */, -/* 98 */, -/* 99 */, -/* 100 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; +/***/ 8467: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +"use strict"; -var Type = __webpack_require__(945); -var _hasOwnProperty = Object.prototype.hasOwnProperty; +Object.defineProperty(exports, "__esModule", ({ value: true })); -function resolveYamlSet(data) { - if (data === null) return true; +var request = __webpack_require__(6234); +var universalUserAgent = __webpack_require__(5030); - var key, object = data; +const VERSION = "4.5.6"; - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; +class GraphqlError extends Error { + constructor(request, response) { + const message = response.data.errors[0].message; + super(message); + Object.assign(this, response.data); + Object.assign(this, { + headers: response.headers + }); + this.name = "GraphqlError"; + this.request = request; // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } } - return true; } -function constructYamlSet(data) { - return data !== null ? data : {}; +const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; +const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request, query, options) { + if (typeof query === "string" && options && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } + + const parsedOptions = typeof query === "string" ? Object.assign({ + query + }, options) : query; + const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; + } + + if (!result.variables) { + result.variables = {}; + } + + result.variables[key] = parsedOptions[key]; + return result; + }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix + // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 + + const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; + + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + + return request(requestOptions).then(response => { + if (response.data.errors) { + const headers = {}; + + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } + + throw new GraphqlError(requestOptions, { + headers, + data: response.data + }); + } + + return response.data.data; + }); } -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet +function withDefaults(request$1, newDefaults) { + const newRequest = request$1.defaults(newDefaults); + + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: request.request.endpoint + }); +} + +const graphql$1 = withDefaults(request.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` + }, + method: "POST", + url: "/graphql" }); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} + +exports.graphql = graphql$1; +exports.withCustomRequest = withCustomRequest; +//# sourceMappingURL=index.js.map /***/ }), -/* 101 */, -/* 102 */, -/* 103 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { -var AWS = __webpack_require__(395); -__webpack_require__(751); +/***/ 4193: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const VERSION = "1.1.2"; /** - * Represents credentials received from the metadata service on an EC2 instance. - * - * By default, this class will connect to the metadata service using - * {AWS.MetadataService} and attempt to load any available credentials. If it - * can connect, and credentials are available, these will be used with zero - * configuration. - * - * This credentials class will by default timeout after 1 second of inactivity - * and retry 3 times. - * If your requests to the EC2 metadata service are timing out, you can increase - * these values by configuring them directly: + * Some “list” response that can be paginated have a different response structure * - * ```javascript - * AWS.config.credentials = new AWS.EC2MetadataCredentials({ - * httpOptions: { timeout: 5000 }, // 5 second timeout - * maxRetries: 10, // retry 10 times - * retryDelayOptions: { base: 200 } // see AWS.Config for information - * }); - * ``` + * 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: * - * @see AWS.Config.retryDelayOptions + * - 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`) * - * @!macro nobrowser + * 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. */ -AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { - constructor: function EC2MetadataCredentials(options) { - AWS.Credentials.call(this); +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. - options = options ? AWS.util.copy(options) : {}; - options = AWS.util.merge( - {maxRetries: this.defaultMaxRetries}, options); - if (!options.httpOptions) options.httpOptions = {}; - options.httpOptions = AWS.util.merge( - {timeout: this.defaultTimeout}, options.httpOptions); + 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; - this.metadataService = new AWS.MetadataService(options); - this.metadata = {}; - }, + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; + } - /** - * @api private - */ - defaultTimeout: 1000, + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } - /** - * @api private - */ - defaultMaxRetries: 3, + 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); + } - /** - * Loads the credentials from the instance metadata service - * - * @callback callback function(err) - * Called when the instance metadata service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, + }); +} - /** - * @api private - * @param callback - */ - load: function load(callback) { - var self = this; - self.metadataService.loadCredentials(function(err, creds) { - if (!err) { - var currentTime = AWS.util.date.getDate(); - var expireTime = new Date(creds.Expiration); - if (expireTime < currentTime) { - err = AWS.util.error( - new Error('EC2 Instance Metadata Serivce provided expired credentials'), - { code: 'EC2MetadataCredentialsProviderFailure' } - ); - } else { - self.expired = false; - self.metadata = creds; - self.accessKeyId = creds.AccessKeyId; - self.secretAccessKey = creds.SecretAccessKey; - self.sessionToken = creds.Token; - self.expireTime = expireTime; +function iterator(octokit, route, parameters) { + const options = octokit.request.endpoint(route, parameters); + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + next() { + if (!url) { + return Promise.resolve({ + done: true + }); } + + 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 + + url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { + value: response + }; + }); } - callback(err); - }); + + }) + }; +} + +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = undefined; } -}); + return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +} -/***/ }), -/* 104 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { +function gather(octokit, results, iterator, mapFn) { + return iterator.next().then(result => { + if (result.done) { + return results; + } -const core = __webpack_require__(470); -const fs = __webpack_require__(747); -const yaml = __webpack_require__(414); + let earlyExit = false; -const github = __webpack_require__(469); -const payload = github.context.payload; + function done() { + earlyExit = true; + } -function fetchBranchConfig(branchName) { - let fileContents = fs.readFileSync('./appspec.yml', 'utf8'); - let data = yaml.safeLoad(fileContents); + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); - for (var prop in data.branch_config) { - var regex = new RegExp('^' + prop + '$', 'i'); - if (branchName.match(regex)) { - if (data.branch_config[prop] == null) { - console.log(`🤷🏻‍♂️ Found an empty appspec.yml -> branch_config for '${branchName}' – skipping deployment`); - process.exit(); - } - console.log(`💡 Using appspec.yml -> branch_config '${prop}' for branch '${branchName}'`); - return data.branch_config[prop]; - } + if (earlyExit) { + return results; } - console.log(`❓ Found no matching appspec.yml -> branch_config for '${branchName}' – skipping deployment`); - process.exit(); + return gather(octokit, results, iterator, mapFn); + }); } -(async function () { - var deploymentId; +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ - const applicationName = core.getInput('application') || payload.repository.name; - const fullRepositoryName = payload.repository.full_name; +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) + }; +} +paginateRest.VERSION = VERSION; - const isPullRequest = payload.pull_request !== undefined; - const commitId = isPullRequest ? payload.pull_request.head.sha : payload.head_commit.id; - const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); - console.log(`🎋 On branch '${branchName}', head commit ${commitId}`); +exports.paginateRest = paginateRest; +//# sourceMappingURL=index.js.map - const branchConfig = fetchBranchConfig(branchName); - const safeBranchName = branchName.replace(/[^a-z0-9-/]+/gi, '-').replace(/\/+/, '--'); - const deploymentGroupName = branchConfig.deploymentGroupName ? branchConfig.deploymentGroupName.replace('$BRANCH', safeBranchName) : safeBranchName; - const deploymentGroupConfig = branchConfig.deploymentGroupConfig; - const deploymentConfig = branchConfig.deploymentConfig; - console.log(`🎳 Using deployment group '${deploymentGroupName}'`); +/***/ }), - const client = __webpack_require__(317); - const codeDeploy = new client(); +/***/ 8883: +/***/ ((__unused_webpack_module, exports) => { - try { - await codeDeploy.updateDeploymentGroup({ - ...deploymentGroupConfig, - ...{ - applicationName: applicationName, - currentDeploymentGroupName: deploymentGroupName - } - }).promise(); - console.log(`⚙️ Updated deployment group '${deploymentGroupName}'`); - core.setOutput('deploymentGroupCreated', false); - } catch (e) { - if (e.code == 'DeploymentGroupDoesNotExistException') { - await codeDeploy.createDeploymentGroup({ - ...deploymentGroupConfig, - ...{ - applicationName: applicationName, - deploymentGroupName: deploymentGroupName, - } - }).promise(); - console.log(`🎯 Created deployment group '${deploymentGroupName}'`); - core.setOutput('deploymentGroupCreated', true); - } else { - throw e; - } - } +"use strict"; - let tries = 0; - while (true) { - if (++tries > 5) { - core.setFailed('🤥 Unable to create a new deployment (too much concurrency?)'); - return; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - try { - var {deploymentId: deploymentId} = await codeDeploy.createDeployment({ - ...deploymentConfig, - ...{ - applicationName: applicationName, - deploymentGroupName: deploymentGroupName, - revision: { - revisionType: 'GitHub', - gitHubLocation: { - commitId: commitId, - repository: fullRepositoryName - } - } - } - }).promise(); - console.log(`🚚️ Created deployment ${deploymentId} – https://console.aws.amazon.com/codesuite/codedeploy/deployments/${deploymentId}?region=${codeDeploy.config.region}`); - core.setOutput('deploymentId', deploymentId); - core.setOutput('deploymentGroupName', deploymentGroupName); - break; - } catch (e) { - if (e.code == 'DeploymentLimitExceededException') { - var [, otherDeployment] = e.message.toString().match(/is already deploying deployment \'(d-\w+)\'/); - console.log(`😶 Waiting for another pending deployment ${otherDeployment}`); - try { - await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: otherDeployment}).promise(); - console.log(`🙂 The pending deployment ${otherDeployment} sucessfully finished.`); - } catch (e) { - console.log(`🤔 The other pending deployment ${otherDeployment} seems to have failed.`); - } - continue; - } else { - throw e; - } - } - } +const VERSION = "1.0.0"; - console.log(`⏲ Waiting for deployment ${deploymentId} to finish`); +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ - try { - await codeDeploy.waitFor('deploymentSuccessful', {deploymentId: deploymentId}).promise(); - console.log('🥳 Deployment successful'); - } catch (e) { - core.setFailed(`😱 The deployment ${deploymentId} seems to have failed.`); - } -})(); +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; +exports.requestLog = requestLog; +//# sourceMappingURL=index.js.map -/***/ }), -/* 105 */, -/* 106 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -__webpack_require__(234); -var AWS = __webpack_require__(395); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +/***/ }), -apiLoader.services['sts'] = {}; -AWS.STS = Service.defineService('sts', ['2011-06-15']); -__webpack_require__(861); -Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { - get: function get() { - var model = __webpack_require__(715); - model.paginators = __webpack_require__(270).pagination; - return model; - }, - enumerable: true, - configurable: true -}); +/***/ 3044: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -module.exports = AWS.STS; +"use strict"; -/***/ }), -/* 107 */ -/***/ (function(__unusedmodule, exports) { +Object.defineProperty(exports, "__esModule", ({ value: true })); -"use strict"; +var deprecation = __webpack_require__(8932); -Object.defineProperty(exports, "__esModule", { value: true }); -var LinkedListNode = /** @class */ (function () { - function LinkedListNode(key, value) { - this.key = key; - this.value = value; - } - return LinkedListNode; -}()); -var LRUCache = /** @class */ (function () { - function LRUCache(size) { - this.nodeMap = {}; - this.size = 0; - if (typeof size !== 'number' || size < 1) { - throw new Error('Cache size can only be positive number'); - } - this.sizeLimit = size; - } - Object.defineProperty(LRUCache.prototype, "length", { - get: function () { - return this.size; +var endpointsByScope = { + actions: { + cancelWorkflowRun: { + method: "POST", + params: { + owner: { + required: true, + type: "string" }, - enumerable: true, - configurable: true - }); - LRUCache.prototype.prependToList = function (node) { - if (!this.headerNode) { - this.tailNode = node; - } - else { - this.headerNode.prev = node; - node.next = this.headerNode; + repo: { + required: true, + type: "string" + }, + run_id: { + required: true, + type: "integer" } - this.headerNode = node; - this.size++; - }; - LRUCache.prototype.removeFromTail = function () { - if (!this.tailNode) { - return undefined; + }, + 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" } - var node = this.tailNode; - var prevNode = node.prev; - if (prevNode) { - prevNode.next = undefined; + }, + url: "/repos/:owner/:repo/actions/secrets/:name" + }, + createRegistrationToken: { + method: "POST", + params: { + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } - node.prev = undefined; - this.tailNode = prevNode; - this.size--; - return node; - }; - LRUCache.prototype.detachFromList = function (node) { - if (this.headerNode === node) { - this.headerNode = node.next; + }, + url: "/repos/:owner/:repo/actions/runners/registration-token" + }, + createRemoveToken: { + method: "POST", + params: { + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } - if (this.tailNode === node) { - this.tailNode = node.prev; + }, + 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" } - if (node.prev) { - node.prev.next = node.next; + }, + 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" } - if (node.next) { - node.next.prev = node.prev; + }, + 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" } - node.next = undefined; - node.prev = undefined; - this.size--; - }; - LRUCache.prototype.get = function (key) { - if (this.nodeMap[key]) { - var node = this.nodeMap[key]; - this.detachFromList(node); - this.prependToList(node); - return node.value; + }, + 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" } - }; - LRUCache.prototype.remove = function (key) { - if (this.nodeMap[key]) { - var node = this.nodeMap[key]; - this.detachFromList(node); - delete this.nodeMap[key]; + }, + url: "/repos/:owner/:repo/actions/artifacts/:artifact_id" + }, + getPublicKey: { + method: "GET", + params: { + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } - }; - LRUCache.prototype.put = function (key, value) { - if (this.nodeMap[key]) { - this.remove(key); + }, + 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" } - else if (this.size === this.sizeLimit) { - var tailNode = this.removeFromTail(); - var key_1 = tailNode.key; - delete this.nodeMap[key_1]; + }, + 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" } - var newNode = new LinkedListNode(key, value); - this.nodeMap[key] = newNode; - this.prependToList(newNode); - }; - LRUCache.prototype.empty = function () { - var keys = Object.keys(this.nodeMap); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var node = this.nodeMap[key]; - this.detachFromList(node); - delete this.nodeMap[key]; + }, + 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" } - }; - return LRUCache; -}()); -exports.LRUCache = LRUCache; - -/***/ }), -/* 108 */, -/* 109 */, -/* 110 */, -/* 111 */, -/* 112 */, -/* 113 */, -/* 114 */, -/* 115 */, -/* 116 */, -/* 117 */, -/* 118 */ -/***/ (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; - - -/***/ }), -/* 119 */, -/* 120 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var LRU_1 = __webpack_require__(107); -var CACHE_SIZE = 1000; -/** - * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache] - */ -var EndpointCache = /** @class */ (function () { - function EndpointCache(maxSize) { - if (maxSize === void 0) { maxSize = CACHE_SIZE; } - this.maxSize = maxSize; - this.cache = new LRU_1.LRUCache(maxSize); - } - ; - Object.defineProperty(EndpointCache.prototype, "size", { - get: function () { - return this.cache.length; + }, + url: "/repos/:owner/:repo/actions/workflows/:workflow_id" + }, + getWorkflowJob: { + method: "GET", + params: { + job_id: { + required: true, + type: "integer" }, - enumerable: true, - configurable: true - }); - EndpointCache.prototype.put = function (key, value) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - var endpointRecord = this.populateValue(value); - this.cache.put(keyString, endpointRecord); - }; - EndpointCache.prototype.get = function (key) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - var now = Date.now(); - var records = this.cache.get(keyString); - if (records) { - for (var i = 0; i < records.length; i++) { - var record = records[i]; - if (record.Expire < now) { - this.cache.remove(keyString); - return undefined; - } - } + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } - return records; - }; - EndpointCache.getKeyString = function (key) { - var identifiers = []; - var identifierNames = Object.keys(key).sort(); - for (var i = 0; i < identifierNames.length; i++) { - var identifierName = identifierNames[i]; - if (key[identifierName] === undefined) - continue; - identifiers.push(key[identifierName]); + }, + 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" } - return identifiers.join(' '); - }; - EndpointCache.prototype.populateValue = function (endpoints) { - var now = Date.now(); - return endpoints.map(function (endpoint) { return ({ - Address: endpoint.Address || '', - Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000 - }); }); - }; - EndpointCache.prototype.empty = function () { - this.cache.empty(); - }; - EndpointCache.prototype.remove = function (key) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - this.cache.remove(keyString); - }; - return EndpointCache; -}()); -exports.EndpointCache = EndpointCache; - -/***/ }), -/* 121 */, -/* 122 */, -/* 123 */, -/* 124 */, -/* 125 */, -/* 126 */ -/***/ (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 size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** 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; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** 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; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * 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; -} - -/** - * 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; - } - } - 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); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - 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; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * 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; -} - -/** - * 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); -} - -/** - * 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]; -} - -/** - * 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) {} - } - 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; -} - -/** 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; - -/** 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; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - nativeCreate = getNative(Object, 'create'); - -/** - * 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]); - } -} - -/** - * 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]; -} - -/** - * 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; -} - -/** - * 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]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * 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; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * 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 - }; -} - -/** - * 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); -} - -/** - * 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; - -/** - * - * 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]); - } -} - -/** - * 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; -} - -/** - * 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); -} - -// 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; + }, + url: "/repos/:owner/:repo/actions/runs/:run_id" + }, + listDownloadsForSelfHostedRunnerApplication: { + method: "GET", + params: { + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } - } - 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; - - -/***/ }), -/* 127 */, -/* 128 */, -/* 129 */ -/***/ (function(module) { - -module.exports = require("child_process"); - -/***/ }), -/* 130 */, -/* 131 */, -/* 132 */, -/* 133 */, -/* 134 */, -/* 135 */, -/* 136 */, -/* 137 */, -/* 138 */, -/* 139 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -// Unique ID creation requires a high quality random # generator. In node.js -// this is pretty straight-forward - we use the crypto API. - -var crypto = __webpack_require__(373); - -module.exports = function nodeRNG() { - return crypto.randomBytes(16); -}; - - -/***/ }), -/* 140 */, -/* 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__(211); -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 TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; - - self.on('free', function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } - } - socket.destroy(); - self.removeSocket(socket); - }); -} -util.inherits(TunnelingAgent, events.EventEmitter); - -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); - - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; - } - - // If we are under maxSockets create a new one. - self.createSocket(options, function(socket) { - socket.on('free', onFree); - socket.on('close', onCloseOrRemove); - socket.on('agentRemove', onCloseOrRemove); - req.onSocket(socket); - - function onFree() { - self.emit('free', socket, options); - } - - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener('free', onFree); - socket.removeListener('close', onCloseOrRemove); - socket.removeListener('agentRemove', onCloseOrRemove); - } - }); -}; - -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); - - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: 'CONNECT', - path: options.host + ':' + options.port, - agent: false, - headers: { - host: options.host + ':' + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64'); - } - - debug('making CONNECT request'); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once('response', onResponse); // for v0.6 - connectReq.once('upgrade', onUpgrade); // for v0.6 - connectReq.once('connect', onConnect); // for v0.7 or later - connectReq.once('error', onError); - connectReq.end(); - - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; - } - - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head); - }); - } - - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); - - if (res.statusCode !== 200) { - debug('tunneling socket could not be established, statusCode=%d', - res.statusCode); - socket.destroy(); - var error = new Error('tunneling socket could not be established, ' + - 'statusCode=' + res.statusCode); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug('got illegal response body from proxy'); - socket.destroy(); - var error = new Error('got illegal response body from proxy'); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - debug('tunneling connection has established'); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - - function onError(cause) { - connectReq.removeAllListeners(); - - debug('tunneling socket could not be established, cause=%s\n', - cause.message, cause.stack); - var error = new Error('tunneling socket could not be established, ' + - 'cause=' + cause.message); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - } -}; - -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); - - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket); - }); - } -}; - -function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - var hostHeader = options.request.getHeader('host'); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host - }); - - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); -} - - -function toOptions(host, port, localAddress) { - if (typeof host === 'string') { // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress - }; - } - return host; // for v0.11 or later -} - -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === 'object') { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; + }, + 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" } - } - } - } - return target; -} - - -var debug; -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0]; - } else { - args.unshift('TUNNEL:'); - } - console.error.apply(console, args); - } -} else { - debug = function() {}; -} -exports.debug = debug; // for test - - -/***/ }), -/* 142 */, -/* 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}`; -} - - -/***/ }), -/* 144 */, -/* 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; - - -/***/ }), -/* 146 */, -/* 147 */, -/* 148 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = paginatePlugin; - -const { paginateRest } = __webpack_require__(299); - -function paginatePlugin(octokit) { - Object.assign(octokit, paginateRest(octokit)); -} - - -/***/ }), -/* 149 */, -/* 150 */, -/* 151 */, -/* 152 */, -/* 153 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -/* eslint guard-for-in:0 */ -var AWS; - -/** - * A set of utility methods for use with the AWS SDK. - * - * @!attribute abort - * Return this value from an iterator function {each} or {arrayEach} - * to break out of the iteration. - * @example Breaking out of an iterator function - * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) { - * if (key == 'b') return AWS.util.abort; - * }); - * @see each - * @see arrayEach - * @api private - */ -var util = { - environment: 'nodejs', - engine: function engine() { - if (util.isBrowser() && typeof navigator !== 'undefined') { - return navigator.userAgent; - } else { - var engine = process.platform + '/' + process.version; - if (process.env.AWS_EXECUTION_ENV) { - engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV; - } - return engine; - } - }, - - userAgent: function userAgent() { - var name = util.environment; - var agent = 'aws-sdk-' + name + '/' + __webpack_require__(395).VERSION; - if (name === 'nodejs') agent += ' ' + util.engine(); - return agent; - }, - - uriEscape: function uriEscape(string) { - var output = encodeURIComponent(string); - output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape); - - // AWS percent-encodes some extra non-standard characters in a URI - output = output.replace(/[*]/g, function(ch) { - return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); - }); - - return output; - }, - - uriEscapePath: function uriEscapePath(string) { - var parts = []; - util.arrayEach(string.split('/'), function (part) { - parts.push(util.uriEscape(part)); - }); - return parts.join('/'); - }, - - urlParse: function urlParse(url) { - return util.url.parse(url); - }, - - urlFormat: function urlFormat(url) { - return util.url.format(url); - }, - - queryStringParse: function queryStringParse(qs) { - return util.querystring.parse(qs); - }, - - queryParamsToString: function queryParamsToString(params) { - var items = []; - var escape = util.uriEscape; - var sortedKeys = Object.keys(params).sort(); - - util.arrayEach(sortedKeys, function(name) { - var value = params[name]; - var ename = escape(name); - var result = ename + '='; - if (Array.isArray(value)) { - var vals = []; - util.arrayEach(value, function(item) { vals.push(escape(item)); }); - result = ename + '=' + vals.sort().join('&' + ename + '='); - } else if (value !== undefined && value !== null) { - result = ename + '=' + escape(value); - } - items.push(result); - }); - - return items.join('&'); - }, - - readFileSync: function readFileSync(path) { - if (util.isBrowser()) return null; - return __webpack_require__(747).readFileSync(path, 'utf-8'); - }, - - base64: { - encode: function encode64(string) { - if (typeof string === 'number') { - throw util.error(new Error('Cannot base64 encode number ' + string)); - } - if (string === null || typeof string === 'undefined') { - return string; - } - var buf = util.buffer.toBuffer(string); - return buf.toString('base64'); - }, - - decode: function decode64(string) { - if (typeof string === 'number') { - throw util.error(new Error('Cannot base64 decode number ' + string)); - } - if (string === null || typeof string === 'undefined') { - return string; - } - return util.buffer.toBuffer(string, 'base64'); - } - - }, - - buffer: { - /** - * Buffer constructor for Node buffer and buffer pollyfill - */ - toBuffer: function(data, encoding) { - return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ? - util.Buffer.from(data, encoding) : new util.Buffer(data, encoding); + }, + url: "/repos/:owner/:repo/actions/runs/:run_id/jobs" }, - - alloc: function(size, fill, encoding) { - if (typeof size !== 'number') { - throw new Error('size passed to alloc must be a number.'); - } - if (typeof util.Buffer.alloc === 'function') { - return util.Buffer.alloc(size, fill, encoding); - } else { - var buf = new util.Buffer(size); - if (fill !== undefined && typeof buf.fill === 'function') { - buf.fill(fill, undefined, undefined, encoding); + 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" } - return buf; - } - }, - - toStream: function toStream(buffer) { - if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer); - - var readable = new (util.stream.Readable)(); - var pos = 0; - readable._read = function(size) { - if (pos >= buffer.length) return readable.push(null); - - var end = pos + size; - if (end > buffer.length) end = buffer.length; - readable.push(buffer.slice(pos, end)); - pos = end; - }; - - return readable; + }, + url: "/repos/:owner/:repo/actions/runs" }, - - /** - * Concatenates a list of Buffer objects. - */ - concat: function(buffers) { - var length = 0, - offset = 0, - buffer = null, i; - - for (i = 0; i < buffers.length; i++) { - length += buffers[i].length; - } - - buffer = util.buffer.alloc(length); - - for (i = 0; i < buffers.length; i++) { - buffers[i].copy(buffer, offset); - offset += buffers[i].length; - } - - return buffer; - } - }, - - string: { - byteLength: function byteLength(string) { - if (string === null || string === undefined) return 0; - if (typeof string === 'string') string = util.buffer.toBuffer(string); - - if (typeof string.byteLength === 'number') { - return string.byteLength; - } else if (typeof string.length === 'number') { - return string.length; - } else if (typeof string.size === 'number') { - return string.size; - } else if (typeof string.path === 'string') { - return __webpack_require__(747).lstatSync(string.path).size; - } else { - throw util.error(new Error('Cannot determine length of ' + string), - { object: string }); - } + 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" }, - - upperFirst: function upperFirst(string) { - return string[0].toUpperCase() + string.substr(1); + 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" }, - - lowerFirst: function lowerFirst(string) { - return string[0].toLowerCase() + string.substr(1); - } - }, - - ini: { - parse: function string(ini) { - var currentSection, map = {}; - util.arrayEach(ini.split(/\r?\n/), function(line) { - line = line.split(/(^|\s)[;#]/)[0]; // remove comments - var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/); - if (section) { - currentSection = section[1]; - } else if (currentSection) { - var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); - if (item) { - map[currentSection] = map[currentSection] || {}; - map[currentSection][item[1]] = item[2]; - } + listSelfHostedRunnersForRepo: { + method: "GET", + params: { + owner: { + required: true, + type: "string" + }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + repo: { + required: true, + type: "string" } - }); - - return map; - } - }, - - fn: { - noop: function() {}, - callback: function (err) { if (err) throw err; }, - - /** - * Turn a synchronous function into as "async" function by making it call - * a callback. The underlying function is called with all but the last argument, - * which is treated as the callback. The callback is passed passed a first argument - * of null on success to mimick standard node callbacks. - */ - makeAsync: function makeAsync(fn, expectedArgs) { - if (expectedArgs && expectedArgs <= fn.length) { - return fn; - } - - return function() { - var args = Array.prototype.slice.call(arguments, 0); - var callback = args.pop(); - var result = fn.apply(null, args); - callback(result); - }; - } - }, - - /** - * Date and time utility functions. - */ - date: { - - /** - * @return [Date] the current JavaScript date object. Since all - * AWS services rely on this date object, you can override - * this function to provide a special time value to AWS service - * requests. - */ - getDate: function getDate() { - if (!AWS) AWS = __webpack_require__(395); - if (AWS.config.systemClockOffset) { // use offset when non-zero - return new Date(new Date().getTime() + AWS.config.systemClockOffset); - } else { - return new Date(); - } + }, + url: "/repos/:owner/:repo/actions/runners" }, - - /** - * @return [String] the date in ISO-8601 format - */ - iso8601: function iso8601(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.toISOString().replace(/\.\d{3}Z$/, 'Z'); + 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" }, - - /** - * @return [String] the date in RFC 822 format - */ - rfc822: function rfc822(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.toUTCString(); + 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" }, - - /** - * @return [Integer] the UNIX timestamp value for the current time - */ - unixTimestamp: function unixTimestamp(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.getTime() / 1000; - }, - - /** - * @param [String,number,Date] date - * @return [Date] - */ - from: function format(date) { - if (typeof date === 'number') { - return new Date(date * 1000); // unix timestamp - } else { - return new Date(date); - } - }, - - /** - * Given a Date or date-like value, this function formats the - * date into a string of the requested value. - * @param [String,number,Date] date - * @param [String] formatter Valid formats are: - # * 'iso8601' - # * 'rfc822' - # * 'unixTimestamp' - * @return [String] - */ - format: function format(date, formatter) { - if (!formatter) formatter = 'iso8601'; - return util.date[formatter](util.date.from(date)); - }, - - parseTimestamp: function parseTimestamp(value) { - if (typeof value === 'number') { // unix timestamp (number) - return new Date(value * 1000); - } else if (value.match(/^\d+$/)) { // unix timestamp - return new Date(value * 1000); - } else if (value.match(/^\d{4}/)) { // iso8601 - return new Date(value); - } else if (value.match(/^\w{3},/)) { // rfc822 - return new Date(value); - } else { - throw util.error( - new Error('unhandled timestamp format: ' + value), - {code: 'TimestampParserError'}); - } - } - - }, - - crypto: { - crc32Table: [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, - 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, - 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, - 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, - 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, - 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, - 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, - 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, - 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, - 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, - 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, - 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, - 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, - 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, - 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, - 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, - 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, - 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, - 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, - 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, - 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, - 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, - 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, - 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, - 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, - 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, - 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, - 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, - 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, - 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, - 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, - 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, - 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, - 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, - 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, - 0x2D02EF8D], - - crc32: function crc32(data) { - var tbl = util.crypto.crc32Table; - var crc = 0 ^ -1; - - if (typeof data === 'string') { - data = util.buffer.toBuffer(data); - } - - for (var i = 0; i < data.length; i++) { - var code = data.readUInt8(i); - crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF]; - } - return (crc ^ -1) >>> 0; - }, - - hmac: function hmac(key, string, digest, fn) { - if (!digest) digest = 'binary'; - if (digest === 'buffer') { digest = undefined; } - if (!fn) fn = 'sha256'; - if (typeof string === 'string') string = util.buffer.toBuffer(string); - return util.crypto.lib.createHmac(fn, key).update(string).digest(digest); - }, - - md5: function md5(data, digest, callback) { - return util.crypto.hash('md5', data, digest, callback); - }, - - sha256: function sha256(data, digest, callback) { - return util.crypto.hash('sha256', data, digest, callback); - }, - - hash: function(algorithm, data, digest, callback) { - var hash = util.crypto.createHash(algorithm); - if (!digest) { digest = 'binary'; } - if (digest === 'buffer') { digest = undefined; } - if (typeof data === 'string') data = util.buffer.toBuffer(data); - var sliceFn = util.arraySliceFn(data); - var isBuffer = util.Buffer.isBuffer(data); - //Identifying objects with an ArrayBuffer as buffers - if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true; - - if (callback && typeof data === 'object' && - typeof data.on === 'function' && !isBuffer) { - data.on('data', function(chunk) { hash.update(chunk); }); - data.on('error', function(err) { callback(err); }); - data.on('end', function() { callback(null, hash.digest(digest)); }); - } else if (callback && sliceFn && !isBuffer && - typeof FileReader !== 'undefined') { - // this might be a File/Blob - var index = 0, size = 1024 * 512; - var reader = new FileReader(); - reader.onerror = function() { - callback(new Error('Failed to read data.')); - }; - reader.onload = function() { - var buf = new util.Buffer(new Uint8Array(reader.result)); - hash.update(buf); - index += buf.length; - reader._continueReading(); - }; - reader._continueReading = function() { - if (index >= data.size) { - callback(null, hash.digest(digest)); - return; - } - - var back = index + size; - if (back > data.size) back = data.size; - reader.readAsArrayBuffer(sliceFn.call(data, index, back)); - }; - - reader._continueReading(); - } else { - if (util.isBrowser() && typeof data === 'object' && !isBuffer) { - data = new util.Buffer(new Uint8Array(data)); + 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" } - var out = hash.update(data).digest(digest); - if (callback) callback(null, out); - return out; - } - }, - - toHex: function toHex(data) { - var out = []; - for (var i = 0; i < data.length; i++) { - out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2)); - } - return out.join(''); + }, + url: "/repos/:owner/:repo/actions/runs/:run_id/logs" }, - - createHash: function createHash(algorithm) { - return util.crypto.lib.createHash(algorithm); - } - - }, - - /** @!ignore */ - - /* Abort constant */ - abort: {}, - - each: function each(object, iterFunction) { - for (var key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - var ret = iterFunction.call(this, key, object[key]); - if (ret === util.abort) break; - } - } - }, - - arrayEach: function arrayEach(array, iterFunction) { - for (var idx in array) { - if (Object.prototype.hasOwnProperty.call(array, idx)) { - var ret = iterFunction.call(this, array[idx], parseInt(idx, 10)); - if (ret === util.abort) break; - } - } - }, - - update: function update(obj1, obj2) { - util.each(obj2, function iterator(key, item) { - obj1[key] = item; - }); - return obj1; - }, - - merge: function merge(obj1, obj2) { - return util.update(util.copy(obj1), obj2); - }, - - copy: function copy(object) { - if (object === null || object === undefined) return object; - var dupe = {}; - // jshint forin:false - for (var key in object) { - dupe[key] = object[key]; - } - return dupe; - }, - - isEmpty: function isEmpty(obj) { - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return false; - } - } - return true; - }, - - arraySliceFn: function arraySliceFn(obj) { - var fn = obj.slice || obj.webkitSlice || obj.mozSlice; - return typeof fn === 'function' ? fn : null; - }, - - isType: function isType(obj, type) { - // handle cross-"frame" objects - if (typeof type === 'function') type = util.typeName(type); - return Object.prototype.toString.call(obj) === '[object ' + type + ']'; - }, - - typeName: function typeName(type) { - if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name; - var str = type.toString(); - var match = str.match(/^\s*function (.+)\(/); - return match ? match[1] : str; - }, - - error: function error(err, options) { - var originalError = null; - if (typeof err.message === 'string' && err.message !== '') { - if (typeof options === 'string' || (options && options.message)) { - originalError = util.copy(err); - originalError.message = err.message; - } - } - err.message = err.message || null; - - if (typeof options === 'string') { - err.message = options; - } else if (typeof options === 'object' && options !== null) { - util.update(err, options); - if (options.message) - err.message = options.message; - if (options.code || options.name) - err.code = options.code || options.name; - if (options.stack) - err.stack = options.stack; - } - - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(err, 'name', {writable: true, enumerable: false}); - Object.defineProperty(err, 'message', {enumerable: true}); - } - - err.name = String(options && options.name || err.name || err.code || 'Error'); - err.time = new Date(); - - if (originalError) err.originalError = originalError; - - return err; - }, - - /** - * @api private - */ - inherit: function inherit(klass, features) { - var newObject = null; - if (features === undefined) { - features = klass; - klass = Object; - newObject = {}; - } else { - var ctor = function ConstructorWrapper() {}; - ctor.prototype = klass.prototype; - newObject = new ctor(); - } - - // constructor not supplied, create pass-through ctor - if (features.constructor === Object) { - features.constructor = function() { - if (klass !== Object) { - return klass.apply(this, arguments); - } - }; - } - - features.constructor.prototype = newObject; - util.update(features.constructor.prototype, features); - features.constructor.__super__ = klass; - return features.constructor; - }, - - /** - * @api private - */ - mixin: function mixin() { - var klass = arguments[0]; - for (var i = 1; i < arguments.length; i++) { - // jshint forin:false - for (var prop in arguments[i].prototype) { - var fn = arguments[i].prototype[prop]; - if (prop !== 'constructor') { - klass.prototype[prop] = fn; - } - } - } - return klass; - }, - - /** - * @api private - */ - hideProperties: function hideProperties(obj, props) { - if (typeof Object.defineProperty !== 'function') return; - - util.arrayEach(props, function (key) { - Object.defineProperty(obj, key, { - enumerable: false, writable: true, configurable: true }); - }); - }, - - /** - * @api private - */ - property: function property(obj, name, value, enumerable, isValue) { - var opts = { - configurable: true, - enumerable: enumerable !== undefined ? enumerable : true - }; - if (typeof value === 'function' && !isValue) { - opts.get = value; - } - else { - opts.value = value; opts.writable = true; - } - - Object.defineProperty(obj, name, opts); - }, - - /** - * @api private - */ - memoizedProperty: function memoizedProperty(obj, name, get, enumerable) { - var cachedValue = null; - - // build enumerable attribute for each value with lazy accessor. - util.property(obj, name, function() { - if (cachedValue === null) { - cachedValue = get(); - } - return cachedValue; - }, enumerable); - }, - - /** - * TODO Remove in major version revision - * This backfill populates response data without the - * top-level payload name. - * - * @api private - */ - hoistPayloadMember: function hoistPayloadMember(resp) { - var req = resp.request; - var operationName = req.operation; - var operation = req.service.api.operations[operationName]; - var output = operation.output; - if (output.payload && !operation.hasEventOutput) { - var payloadMember = output.members[output.payload]; - var responsePayload = resp.data[output.payload]; - if (payloadMember.type === 'structure') { - util.each(responsePayload, function(key, value) { - util.property(resp.data, key, value, false); - }); - } - } - }, - - /** - * Compute SHA-256 checksums of streams - * - * @api private - */ - computeSha256: function computeSha256(body, done) { - if (util.isNode()) { - var Stream = util.stream.Stream; - var fs = __webpack_require__(747); - if (typeof Stream === 'function' && body instanceof Stream) { - if (typeof body.path === 'string') { // assume file object - var settings = {}; - if (typeof body.start === 'number') { - settings.start = body.start; - } - if (typeof body.end === 'number') { - settings.end = body.end; - } - body = fs.createReadStream(body.path, settings); - } else { // TODO support other stream types - return done(new Error('Non-file stream objects are ' + - 'not supported with SigV4')); - } - } - } - - util.crypto.sha256(body, 'hex', function(err, sha) { - if (err) done(err); - else done(null, sha); - }); - }, - - /** - * @api private - */ - isClockSkewed: function isClockSkewed(serverTime) { - if (serverTime) { - util.property(AWS.config, 'isClockSkewed', - Math.abs(new Date().getTime() - serverTime) >= 300000, false); - return AWS.config.isClockSkewed; - } - }, - - applyClockOffset: function applyClockOffset(serverTime) { - if (serverTime) - AWS.config.systemClockOffset = serverTime - new Date().getTime(); - }, - - /** - * @api private - */ - extractRequestId: function extractRequestId(resp) { - var requestId = resp.httpResponse.headers['x-amz-request-id'] || - resp.httpResponse.headers['x-amzn-requestid']; - - if (!requestId && resp.data && resp.data.ResponseMetadata) { - requestId = resp.data.ResponseMetadata.RequestId; - } - - if (requestId) { - resp.requestId = requestId; - } - - if (resp.error) { - resp.error.requestId = requestId; - } - }, - - /** - * @api private - */ - addPromises: function addPromises(constructors, PromiseDependency) { - var deletePromises = false; - if (PromiseDependency === undefined && AWS && AWS.config) { - PromiseDependency = AWS.config.getPromisesDependency(); - } - if (PromiseDependency === undefined && typeof Promise !== 'undefined') { - PromiseDependency = Promise; - } - if (typeof PromiseDependency !== 'function') deletePromises = true; - if (!Array.isArray(constructors)) constructors = [constructors]; - - for (var ind = 0; ind < constructors.length; ind++) { - var constructor = constructors[ind]; - if (deletePromises) { - if (constructor.deletePromisesFromClass) { - constructor.deletePromisesFromClass(); - } - } else if (constructor.addPromisesToClass) { - constructor.addPromisesToClass(PromiseDependency); - } - } - }, - - /** - * @api private - * Return a function that will return a promise whose fate is decided by the - * callback behavior of the given method with `methodName`. The method to be - * promisified should conform to node.js convention of accepting a callback as - * last argument and calling that callback with error as the first argument - * and success value on the second argument. - */ - promisifyMethod: function promisifyMethod(methodName, PromiseDependency) { - return function promise() { - var self = this; - var args = Array.prototype.slice.call(arguments); - return new PromiseDependency(function(resolve, reject) { - args.push(function(err, data) { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - self[methodName].apply(self, args); - }); - }; - }, - - /** - * @api private - */ - isDualstackAvailable: function isDualstackAvailable(service) { - if (!service) return false; - var metadata = __webpack_require__(694); - if (typeof service !== 'string') service = service.serviceIdentifier; - if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false; - return !!metadata[service].dualstackAvailable; - }, - - /** - * @api private - */ - calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) { - if (!retryDelayOptions) retryDelayOptions = {}; - var customBackoff = retryDelayOptions.customBackoff || null; - if (typeof customBackoff === 'function') { - return customBackoff(retryCount, err); - } - var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100; - var delay = Math.random() * (Math.pow(2, retryCount) * base); - return delay; - }, - - /** - * @api private - */ - handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) { - if (!options) options = {}; - var http = AWS.HttpClient.getInstance(); - var httpOptions = options.httpOptions || {}; - var retryCount = 0; - - var errCallback = function(err) { - var maxRetries = options.maxRetries || 0; - if (err && err.code === 'TimeoutError') err.retryable = true; - var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err); - if (err && err.retryable && retryCount < maxRetries && delay >= 0) { - retryCount++; - setTimeout(sendRequest, delay + (err.retryAfter || 0)); - } else { - cb(err); - } - }; - - var sendRequest = function() { - var data = ''; - http.handleRequest(httpRequest, httpOptions, function(httpResponse) { - httpResponse.on('data', function(chunk) { data += chunk.toString(); }); - httpResponse.on('end', function() { - var statusCode = httpResponse.statusCode; - if (statusCode < 300) { - cb(null, data); - } else { - var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0; - var err = util.error(new Error(), - { - statusCode: statusCode, - retryable: statusCode >= 500 || statusCode === 429 - } - ); - if (retryAfter && err.retryable) err.retryAfter = retryAfter; - errCallback(err); - } - }); - }, errCallback); - }; - - AWS.util.defer(sendRequest); - }, - - /** - * @api private - */ - uuid: { - v4: function uuidV4() { - return __webpack_require__(700).v4(); - } - }, - - /** - * @api private - */ - convertPayloadToString: function convertPayloadToString(resp) { - var req = resp.request; - var operation = req.operation; - var rules = req.service.api.operations[operation].output || {}; - if (rules.payload && resp.data[rules.payload]) { - resp.data[rules.payload] = resp.data[rules.payload].toString(); - } - }, - - /** - * @api private - */ - defer: function defer(callback) { - if (typeof process === 'object' && typeof process.nextTick === 'function') { - process.nextTick(callback); - } else if (typeof setImmediate === 'function') { - setImmediate(callback); - } else { - setTimeout(callback, 0); - } - }, - - /** - * @api private - */ - getRequestPayloadShape: function getRequestPayloadShape(req) { - var operations = req.service.api.operations; - if (!operations) return undefined; - var operation = (operations || {})[req.operation]; - if (!operation || !operation.input || !operation.input.payload) return undefined; - return operation.input.members[operation.input.payload]; - }, - - getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) { - var profiles = {}; - var profilesFromConfig = {}; - if (process.env[util.configOptInEnv]) { - var profilesFromConfig = iniLoader.loadFrom({ - isConfig: true, - filename: process.env[util.sharedConfigFileEnv] - }); - } - var profilesFromCreds = iniLoader.loadFrom({ - filename: filename || - (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]) - }); - for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) { - profiles[profileNames[i]] = profilesFromConfig[profileNames[i]]; - } - for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) { - profiles[profileNames[i]] = profilesFromCreds[profileNames[i]]; - } - return profiles; - }, - - /** - * @api private - */ - ARN: { - validate: function validateARN(str) { - return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6; - }, - parse: function parseARN(arn) { - var matched = arn.split(':'); - return { - partition: matched[1], - service: matched[2], - region: matched[3], - accountId: matched[4], - resource: matched.slice(5).join(':') - }; - }, - build: function buildARN(arnObject) { - if ( - arnObject.service === undefined || - arnObject.region === undefined || - arnObject.accountId === undefined || - arnObject.resource === undefined - ) throw util.error(new Error('Input ARN object is invalid')); - return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service + - ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource; - } - }, - - /** - * @api private - */ - defaultProfile: 'default', - - /** - * @api private - */ - configOptInEnv: 'AWS_SDK_LOAD_CONFIG', - - /** - * @api private - */ - sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE', - - /** - * @api private - */ - sharedConfigFileEnv: 'AWS_CONFIG_FILE', - - /** - * @api private - */ - imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED' -}; - -/** - * @api private - */ -module.exports = util; - - -/***/ }), -/* 154 */ -/***/ (function(module) { - -module.exports = {"version":2,"waiters":{"DeploymentSuccessful":{"delay":15,"operation":"GetDeployment","maxAttempts":120,"acceptors":[{"expected":"Succeeded","matcher":"path","state":"success","argument":"deploymentInfo.status"},{"expected":"Failed","matcher":"path","state":"failure","argument":"deploymentInfo.status"},{"expected":"Stopped","matcher":"path","state":"failure","argument":"deploymentInfo.status"}]}}}; - -/***/ }), -/* 155 */, -/* 156 */, -/* 157 */, -/* 158 */, -/* 159 */, -/* 160 */, -/* 161 */, -/* 162 */, -/* 163 */, -/* 164 */, -/* 165 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var property = __webpack_require__(153).property; - -function Paginator(name, paginator) { - property(this, 'inputToken', paginator.input_token); - property(this, 'limitKey', paginator.limit_key); - property(this, 'moreResults', paginator.more_results); - property(this, 'outputToken', paginator.output_token); - property(this, 'resultKey', paginator.result_key); -} - -/** - * @api private - */ -module.exports = Paginator; - - -/***/ }), -/* 166 */, -/* 167 */, -/* 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; -}; - - -/***/ }), -/* 169 */, -/* 170 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { - -var AWS = __webpack_require__(395); -var CognitoIdentity = __webpack_require__(214); -var STS = __webpack_require__(106); - -/** - * Represents credentials retrieved from STS Web Identity Federation using - * the Amazon Cognito Identity service. - * - * By default this provider gets credentials using the - * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which - * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito - * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to - * obtain an `IdentityId`. If the identity or identity pool is not configured in - * the Amazon Cognito Console to use IAM roles with the appropriate permissions, - * then additionally a `RoleArn` is required containing the ARN of the IAM trust - * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` - * is provided, then this provider gets credentials using the - * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an - * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. - * - * In addition, if this credential provider is used to provide authenticated - * login, the `Logins` map may be set to the tokens provided by the respective - * identity providers. See {constructor} for an example on creating a credentials - * object with proper property values. - * - * ## Refreshing Credentials from Identity Service - * - * In addition to AWS credentials expiring after a given amount of time, the - * login token from the identity provider will also expire. Once this token - * expires, it will not be usable to refresh AWS credentials, and another - * token will be needed. The SDK does not manage refreshing of the token value, - * but this can be done through a "refresh token" supported by most identity - * providers. Consult the documentation for the identity provider for refreshing - * tokens. Once the refreshed token is acquired, you should make sure to update - * this new token in the credentials object's {params} property. The following - * code will update the WebIdentityToken, assuming you have retrieved an updated - * token from the identity provider: - * - * ```javascript - * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; - * ``` - * - * Future calls to `credentials.refresh()` will now use the new token. - * - * @!attribute params - * @return [map] the map of params passed to - * {AWS.CognitoIdentity.getId}, - * {AWS.CognitoIdentity.getOpenIdToken}, and - * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the - * `params.WebIdentityToken` property. - * @!attribute data - * @return [map] the raw data response from the call to - * {AWS.CognitoIdentity.getCredentialsForIdentity}, or - * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get - * access to other properties from the response. - * @!attribute identityId - * @return [String] the Cognito ID returned by the last call to - * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual - * final resolved identity ID from Amazon Cognito. - */ -AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * @api private - */ - localStorageKey: { - id: 'aws.cognito.identity-id.', - providers: 'aws.cognito.identity-providers.' - }, - - /** - * Creates a new credentials object. - * @example Creating a new credentials object - * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ - * - * // either IdentityPoolId or IdentityId is required - * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) - * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity - * // or AWS.CognitoIdentity.getOpenIdToken (linked below) - * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', - * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' - * - * // optional, only necessary when the identity pool is not configured - * // to use IAM roles in the Amazon Cognito Console - * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) - * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', - * - * // optional tokens, used for authenticated login - * // See the Logins param for AWS.CognitoIdentity.getID (linked below) - * Logins: { - * 'graph.facebook.com': 'FBTOKEN', - * 'www.amazon.com': 'AMAZONTOKEN', - * 'accounts.google.com': 'GOOGLETOKEN', - * 'api.twitter.com': 'TWITTERTOKEN', - * 'www.digits.com': 'DIGITSTOKEN' - * }, - * - * // optional name, defaults to web-identity - * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) - * RoleSessionName: 'web', - * - * // optional, only necessary when application runs in a browser - * // and multiple users are signed in at once, used for caching - * LoginId: 'example@gmail.com' - * - * }, { - * // optionally provide configuration to apply to the underlying service clients - * // if configuration is not provided, then configuration will be pulled from AWS.config - * - * // region should match the region your identity pool is located in - * region: 'us-east-1', - * - * // specify timeout options - * httpOptions: { - * timeout: 100 - * } - * }); - * @see AWS.CognitoIdentity.getId - * @see AWS.CognitoIdentity.getCredentialsForIdentity - * @see AWS.STS.assumeRoleWithWebIdentity - * @see AWS.CognitoIdentity.getOpenIdToken - * @see AWS.Config - * @note If a region is not provided in the global AWS.config, or - * specified in the `clientConfig` to the CognitoIdentityCredentials - * constructor, you may encounter a 'Missing credentials in config' error - * when calling making a service call. - */ - constructor: function CognitoIdentityCredentials(params, clientConfig) { - AWS.Credentials.call(this); - this.expired = true; - this.params = params; - this.data = null; - this._identityId = null; - this._clientConfig = AWS.util.copy(clientConfig || {}); - this.loadCachedId(); - var self = this; - Object.defineProperty(this, 'identityId', { - get: function() { - self.loadCachedId(); - return self._identityId || self.params.IdentityId; - }, - set: function(identityId) { - self._identityId = identityId; - } - }); - }, - - /** - * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, - * or {AWS.STS.assumeRoleWithWebIdentity}. - * - * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see AWS.Credentials.get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, - - /** - * @api private - * @param callback - */ - load: function load(callback) { - var self = this; - self.createClients(); - self.data = null; - self._identityId = null; - self.getId(function(err) { - if (!err) { - if (!self.params.RoleArn) { - self.getCredentialsForIdentity(callback); - } else { - self.getCredentialsFromSTS(callback); - } - } else { - self.clearIdOnNotAuthorized(err); - callback(err); - } - }); - }, - - /** - * Clears the cached Cognito ID associated with the currently configured - * identity pool ID. Use this to manually invalidate your cache if - * the identity pool ID was deleted. - */ - clearCachedId: function clearCache() { - this._identityId = null; - delete this.params.IdentityId; - - var poolId = this.params.IdentityPoolId; - var loginId = this.params.LoginId || ''; - delete this.storage[this.localStorageKey.id + poolId + loginId]; - delete this.storage[this.localStorageKey.providers + poolId + loginId]; - }, - - /** - * @api private - */ - clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { - var self = this; - if (err.code == 'NotAuthorizedException') { - self.clearCachedId(); - } - }, - - /** - * Retrieves a Cognito ID, loading from cache if it was already retrieved - * on this device. - * - * @callback callback function(err, identityId) - * @param err [Error, null] an error object if the call failed or null if - * it succeeded. - * @param identityId [String, null] if successful, the callback will return - * the Cognito ID. - * @note If not loaded explicitly, the Cognito ID is loaded and stored in - * localStorage in the browser environment of a device. - * @api private - */ - getId: function getId(callback) { - var self = this; - if (typeof self.params.IdentityId === 'string') { - return callback(null, self.params.IdentityId); - } - - self.cognito.getId(function(err, data) { - if (!err && data.IdentityId) { - self.params.IdentityId = data.IdentityId; - callback(null, data.IdentityId); - } else { - callback(err); - } - }); - }, - - - /** - * @api private - */ - loadCredentials: function loadCredentials(data, credentials) { - if (!data || !credentials) return; - credentials.expired = false; - credentials.accessKeyId = data.Credentials.AccessKeyId; - credentials.secretAccessKey = data.Credentials.SecretKey; - credentials.sessionToken = data.Credentials.SessionToken; - credentials.expireTime = data.Credentials.Expiration; - }, - - /** - * @api private - */ - getCredentialsForIdentity: function getCredentialsForIdentity(callback) { - var self = this; - self.cognito.getCredentialsForIdentity(function(err, data) { - if (!err) { - self.cacheId(data); - self.data = data; - self.loadCredentials(self.data, self); - } else { - self.clearIdOnNotAuthorized(err); - } - callback(err); - }); - }, - - /** - * @api private - */ - getCredentialsFromSTS: function getCredentialsFromSTS(callback) { - var self = this; - self.cognito.getOpenIdToken(function(err, data) { - if (!err) { - self.cacheId(data); - self.params.WebIdentityToken = data.Token; - self.webIdentityCredentials.refresh(function(webErr) { - if (!webErr) { - self.data = self.webIdentityCredentials.data; - self.sts.credentialsFrom(self.data, self); - } - callback(webErr); - }); - } else { - self.clearIdOnNotAuthorized(err); - callback(err); - } - }); - }, - - /** - * @api private - */ - loadCachedId: function loadCachedId() { - var self = this; - - // in the browser we source default IdentityId from localStorage - if (AWS.util.isBrowser() && !self.params.IdentityId) { - var id = self.getStorage('id'); - if (id && self.params.Logins) { - var actualProviders = Object.keys(self.params.Logins); - var cachedProviders = - (self.getStorage('providers') || '').split(','); - - // only load ID if at least one provider used this ID before - var intersect = cachedProviders.filter(function(n) { - return actualProviders.indexOf(n) !== -1; - }); - if (intersect.length !== 0) { - self.params.IdentityId = id; - } - } else if (id) { - self.params.IdentityId = id; - } - } - }, - - /** - * @api private - */ - createClients: function() { - var clientConfig = this._clientConfig; - this.webIdentityCredentials = this.webIdentityCredentials || - new AWS.WebIdentityCredentials(this.params, clientConfig); - if (!this.cognito) { - var cognitoConfig = AWS.util.merge({}, clientConfig); - cognitoConfig.params = this.params; - this.cognito = new CognitoIdentity(cognitoConfig); - } - this.sts = this.sts || new STS(clientConfig); - }, - - /** - * @api private - */ - cacheId: function cacheId(data) { - this._identityId = data.IdentityId; - this.params.IdentityId = this._identityId; - - // cache this IdentityId in browser localStorage if possible - if (AWS.util.isBrowser()) { - this.setStorage('id', data.IdentityId); - - if (this.params.Logins) { - this.setStorage('providers', Object.keys(this.params.Logins).join(',')); - } - } - }, - - /** - * @api private - */ - getStorage: function getStorage(key) { - return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; - }, - - /** - * @api private - */ - setStorage: function setStorage(key, val) { - try { - this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; - } catch (_) {} - }, - - /** - * @api private - */ - storage: (function() { - try { - var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? - window.localStorage : {}; - - // Test set/remove which would throw an error in Safari's private browsing - storage['aws.test-storage'] = 'foobar'; - delete storage['aws.test-storage']; - - return storage; - } catch (_) { - return {}; - } - })() -}); - - -/***/ }), -/* 171 */, -/* 172 */, -/* 173 */, -/* 174 */, -/* 175 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var util = __webpack_require__(395).util; -var toBuffer = util.buffer.toBuffer; - -// All prelude components are unsigned, 32-bit integers -var PRELUDE_MEMBER_LENGTH = 4; -// The prelude consists of two components -var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; -// Checksums are always CRC32 hashes. -var CHECKSUM_LENGTH = 4; -// Messages must include a full prelude, a prelude checksum, and a message checksum -var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; - -/** - * @api private - * - * @param {Buffer} message - */ -function splitMessage(message) { - if (!util.Buffer.isBuffer(message)) message = toBuffer(message); - - if (message.length < MINIMUM_MESSAGE_LENGTH) { - throw new Error('Provided message too short to accommodate event stream message overhead'); - } - - if (message.length !== message.readUInt32BE(0)) { - throw new Error('Reported message length does not match received message length'); - } - - var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); - - if ( - expectedPreludeChecksum !== util.crypto.crc32( - message.slice(0, PRELUDE_LENGTH) - ) - ) { - throw new Error( - 'The prelude checksum specified in the message (' + - expectedPreludeChecksum + - ') does not match the calculated CRC32 checksum.' - ); - } - - var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); - - if ( - expectedMessageChecksum !== util.crypto.crc32( - message.slice(0, message.length - CHECKSUM_LENGTH) - ) - ) { - throw new Error( - 'The message checksum did not match the expected value of ' + - expectedMessageChecksum - ); - } - - var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; - var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); - - return { - headers: message.slice(headersStart, headersEnd), - body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), - }; -} - -/** - * @api private - */ -module.exports = { - splitMessage: splitMessage -}; - - -/***/ }), -/* 176 */, -/* 177 */, -/* 178 */, -/* 179 */, -/* 180 */, -/* 181 */, -/* 182 */, -/* 183 */, -/* 184 */, -/* 185 */, -/* 186 */, -/* 187 */ -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { - -var AWS = __webpack_require__(395); -__webpack_require__(923); -__webpack_require__(906); -var PromisesDependency; - -/** - * The main configuration class used by all service objects to set - * the region, credentials, and other options for requests. - * - * By default, credentials and region settings are left unconfigured. - * This should be configured by the application before using any - * AWS service APIs. - * - * In order to set global configuration options, properties should - * be assigned to the global {AWS.config} object. - * - * @see AWS.config - * - * @!group General Configuration Options - * - * @!attribute credentials - * @return [AWS.Credentials] the AWS credentials to sign requests with. - * - * @!attribute region - * @example Set the global region setting to us-west-2 - * AWS.config.update({region: 'us-west-2'}); - * @return [AWS.Credentials] The region to send service requests to. - * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html - * A list of available endpoints for each AWS service - * - * @!attribute maxRetries - * @return [Integer] the maximum amount of retries to perform for a - * service request. By default this value is calculated by the specific - * service object that the request is being made to. - * - * @!attribute maxRedirects - * @return [Integer] the maximum amount of redirects to follow for a - * service request. Defaults to 10. - * - * @!attribute paramValidation - * @return [Boolean|map] whether input parameters should be validated against - * the operation description before sending the request. Defaults to true. - * Pass a map to enable any of the following specific validation features: - * - * * **min** [Boolean] — Validates that a value meets the min - * constraint. This is enabled by default when paramValidation is set - * to `true`. - * * **max** [Boolean] — Validates that a value meets the max - * constraint. - * * **pattern** [Boolean] — Validates that a string value matches a - * regular expression. - * * **enum** [Boolean] — Validates that a string value matches one - * of the allowable enum values. - * - * @!attribute computeChecksums - * @return [Boolean] whether to compute checksums for payload bodies when - * the service accepts it (currently supported in S3 only). - * - * @!attribute convertResponseTypes - * @return [Boolean] whether types are converted when parsing response data. - * Currently only supported for JSON based services. Turning this off may - * improve performance on large response payloads. Defaults to `true`. - * - * @!attribute correctClockSkew - * @return [Boolean] whether to apply a clock skew correction and retry - * requests that fail because of an skewed client clock. Defaults to - * `false`. - * - * @!attribute sslEnabled - * @return [Boolean] whether SSL is enabled for requests - * - * @!attribute s3ForcePathStyle - * @return [Boolean] whether to force path style URLs for S3 objects - * - * @!attribute s3BucketEndpoint - * @note Setting this configuration option requires an `endpoint` to be - * provided explicitly to the service constructor. - * @return [Boolean] whether the provided endpoint addresses an individual - * bucket (false if it addresses the root API endpoint). - * - * @!attribute s3DisableBodySigning - * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. - * Body signing can only be disabled when using https. Defaults to `true`. - * - * @!attribute s3UsEast1RegionalEndpoint - * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 - * request to global endpoints or 'us-east-1' regional endpoints. This config is only - * applicable to S3 client; - * Defaults to 'legacy' - * @!attribute s3UseArnRegion - * @return [Boolean] whether to override the request region with the region inferred - * from requested resource's ARN. Only available for S3 buckets - * Defaults to `true` - * - * @!attribute useAccelerateEndpoint - * @note This configuration option is only compatible with S3 while accessing - * dns-compatible buckets. - * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. - * Defaults to `false`. - * - * @!attribute retryDelayOptions - * @example Set the base retry delay for all services to 300 ms - * AWS.config.update({retryDelayOptions: {base: 300}}); - * // Delays with maxRetries = 3: 300, 600, 1200 - * @example Set a custom backoff function to provide delay values on retries - * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { - * // returns delay in ms - * }}}); - * @return [map] A set of options to configure the retry delay on retryable errors. - * Currently supported options are: - * - * * **base** [Integer] — The base number of milliseconds to use in the - * exponential backoff for operation retries. Defaults to 100 ms for all services except - * DynamoDB, where it defaults to 50ms. - * - * * **customBackoff ** [function] — A custom function that accepts a - * retry count and error and returns the amount of time to delay in - * milliseconds. If the result is a non-zero negative value, no further - * retry attempts will be made. The `base` option will be ignored if this - * option is supplied. - * - * @!attribute httpOptions - * @return [map] A set of options to pass to the low-level HTTP request. - * Currently supported options are: - * - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only supported in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — Sets the socket to timeout after timeout - * milliseconds of inactivity on the socket. Defaults to two minutes - * (120000) - * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous - * HTTP requests. Used in the browser environment only. Set to false to - * send requests synchronously. Defaults to true (async on). - * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" - * property of an XMLHttpRequest object. Used in the browser environment - * only. Defaults to false. - * @!attribute logger - * @return [#write,#log] an object that responds to .write() (like a stream) - * or .log() (like the console object) in order to log information about - * requests - * - * @!attribute systemClockOffset - * @return [Number] an offset value in milliseconds to apply to all signing - * times. Use this to compensate for clock skew when your system may be - * out of sync with the service time. Note that this configuration option - * can only be applied to the global `AWS.config` object and cannot be - * overridden in service-specific configuration. Defaults to 0 milliseconds. - * - * @!attribute signatureVersion - * @return [String] the signature version to sign requests with (overriding - * the API configuration). Possible values are: 'v2', 'v3', 'v4'. - * - * @!attribute signatureCache - * @return [Boolean] whether the signature to sign requests with (overriding - * the API configuration) is cached. Only applies to the signature version 'v4'. - * Defaults to `true`. - * - * @!attribute endpointDiscoveryEnabled - * @return [Boolean|undefined] whether to call operations with endpoints - * given by service dynamically. Setting this config to `true` will enable - * endpoint discovery for all applicable operations. Setting it to `false` - * will explicitly disable endpoint discovery even though operations that - * require endpoint discovery will presumably fail. Leaving it to - * `undefined` means SDK only do endpoint discovery when it's required. - * Defaults to `undefined` - * - * @!attribute endpointCacheSize - * @return [Number] the size of the global cache storing endpoints from endpoint - * discovery operations. Once endpoint cache is created, updating this setting - * cannot change existing cache size. - * Defaults to 1000 - * - * @!attribute hostPrefixEnabled - * @return [Boolean] whether to marshal request parameters to the prefix of - * hostname. Defaults to `true`. - * - * @!attribute stsRegionalEndpoints - * @return ['legacy'|'regional'] whether to send sts request to global endpoints or - * regional endpoints. - * Defaults to 'legacy' - */ -AWS.Config = AWS.util.inherit({ - /** - * @!endgroup - */ - - /** - * Creates a new configuration object. This is the object that passes - * option data along to service requests, including credentials, security, - * region information, and some service specific settings. - * - * @example Creating a new configuration object with credentials and region - * var config = new AWS.Config({ - * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' - * }); - * @option options accessKeyId [String] your AWS access key ID. - * @option options secretAccessKey [String] your AWS secret access key. - * @option options sessionToken [AWS.Credentials] the optional AWS - * session token to sign requests with. - * @option options credentials [AWS.Credentials] the AWS credentials - * to sign requests with. You can either specify this object, or - * specify the accessKeyId and secretAccessKey options directly. - * @option options credentialProvider [AWS.CredentialProviderChain] the - * provider chain used to resolve credentials if no static `credentials` - * property is set. - * @option options region [String] the region to send service requests to. - * See {region} for more information. - * @option options maxRetries [Integer] the maximum amount of retries to - * attempt with a request. See {maxRetries} for more information. - * @option options maxRedirects [Integer] the maximum amount of redirects to - * follow with a request. See {maxRedirects} for more information. - * @option options sslEnabled [Boolean] whether to enable SSL for - * requests. - * @option options paramValidation [Boolean|map] whether input parameters - * should be validated against the operation description before sending - * the request. Defaults to true. Pass a map to enable any of the - * following specific validation features: - * - * * **min** [Boolean] — Validates that a value meets the min - * constraint. This is enabled by default when paramValidation is set - * to `true`. - * * **max** [Boolean] — Validates that a value meets the max - * constraint. - * * **pattern** [Boolean] — Validates that a string value matches a - * regular expression. - * * **enum** [Boolean] — Validates that a string value matches one - * of the allowable enum values. - * @option options computeChecksums [Boolean] whether to compute checksums - * for payload bodies when the service accepts it (currently supported - * in S3 only) - * @option options convertResponseTypes [Boolean] whether types are converted - * when parsing response data. Currently only supported for JSON based - * services. Turning this off may improve performance on large response - * payloads. Defaults to `true`. - * @option options correctClockSkew [Boolean] whether to apply a clock skew - * correction and retry requests that fail because of an skewed client - * clock. Defaults to `false`. - * @option options s3ForcePathStyle [Boolean] whether to force path - * style URLs for S3 objects. - * @option options s3BucketEndpoint [Boolean] whether the provided endpoint - * addresses an individual bucket (false if it addresses the root API - * endpoint). Note that setting this configuration option requires an - * `endpoint` to be provided explicitly to the service constructor. - * @option options s3DisableBodySigning [Boolean] whether S3 body signing - * should be disabled when using signature version `v4`. Body signing - * can only be disabled when using https. Defaults to `true`. - * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region - * is set to 'us-east-1', whether to send s3 request to global endpoints or - * 'us-east-1' regional endpoints. This config is only applicable to S3 client. - * Defaults to `legacy` - * @option options s3UseArnRegion [Boolean] whether to override the request region - * with the region inferred from requested resource's ARN. Only available for S3 buckets - * Defaults to `true` - * - * @option options retryDelayOptions [map] A set of options to configure - * the retry delay on retryable errors. Currently supported options are: - * - * * **base** [Integer] — The base number of milliseconds to use in the - * exponential backoff for operation retries. Defaults to 100 ms for all - * services except DynamoDB, where it defaults to 50ms. - * * **customBackoff ** [function] — A custom function that accepts a - * retry count and error and returns the amount of time to delay in - * milliseconds. If the result is a non-zero negative value, no further - * retry attempts will be made. The `base` option will be ignored if this - * option is supplied. - * @option options httpOptions [map] A set of options to pass to the low-level - * HTTP request. Currently supported options are: - * - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Defaults to the global - * agent (`http.globalAgent`) for non-SSL connections. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only available in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — Sets the socket to timeout after timeout - * milliseconds of inactivity on the socket. Defaults to two minutes - * (120000). - * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous - * HTTP requests. Used in the browser environment only. Set to false to - * send requests synchronously. Defaults to true (async on). - * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" - * property of an XMLHttpRequest object. Used in the browser environment - * only. Defaults to false. - * @option options apiVersion [String, Date] a String in YYYY-MM-DD format - * (or a date) that represents the latest possible API version that can be - * used in all services (unless overridden by `apiVersions`). Specify - * 'latest' to use the latest possible version. - * @option options apiVersions [map] a map of service - * identifiers (the lowercase service class name) with the API version to - * use when instantiating a service. Specify 'latest' for each individual - * that can use the latest available version. - * @option options logger [#write,#log] an object that responds to .write() - * (like a stream) or .log() (like the console object) in order to log - * information about requests - * @option options systemClockOffset [Number] an offset value in milliseconds - * to apply to all signing times. Use this to compensate for clock skew - * when your system may be out of sync with the service time. Note that - * this configuration option can only be applied to the global `AWS.config` - * object and cannot be overridden in service-specific configuration. - * Defaults to 0 milliseconds. - * @option options signatureVersion [String] the signature version to sign - * requests with (overriding the API configuration). Possible values are: - * 'v2', 'v3', 'v4'. - * @option options signatureCache [Boolean] whether the signature to sign - * requests with (overriding the API configuration) is cached. Only applies - * to the signature version 'v4'. Defaults to `true`. - * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 - * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. - * @option options useAccelerateEndpoint [Boolean] Whether to use the - * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. - * @option options clientSideMonitoring [Boolean] whether to collect and - * publish this client's performance metrics of all its API requests. - * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to - * call operations with endpoints given by service dynamically. Setting this - * config to `true` will enable endpoint discovery for all applicable operations. - * Setting it to `false` will explicitly disable endpoint discovery even though - * operations that require endpoint discovery will presumably fail. Leaving it - * to `undefined` means SDK will only do endpoint discovery when it's required. - * Defaults to `undefined` - * @option options endpointCacheSize [Number] the size of the global cache storing - * endpoints from endpoint discovery operations. Once endpoint cache is created, - * updating this setting cannot change existing cache size. - * Defaults to 1000 - * @option options hostPrefixEnabled [Boolean] whether to marshal request - * parameters to the prefix of hostname. - * Defaults to `true`. - * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request - * to global endpoints or regional endpoints. - * Defaults to 'legacy'. - */ - constructor: function Config(options) { - if (options === undefined) options = {}; - options = this.extractCredentials(options); - - AWS.util.each.call(this, this.keys, function (key, value) { - this.set(key, options[key], value); - }); - }, - - /** - * @!group Managing Credentials - */ - - /** - * Loads credentials from the configuration object. This is used internally - * by the SDK to ensure that refreshable {Credentials} objects are properly - * refreshed and loaded when sending a request. If you want to ensure that - * your credentials are loaded prior to a request, you can use this method - * directly to provide accurate credential data stored in the object. - * - * @note If you configure the SDK with static or environment credentials, - * the credential data should already be present in {credentials} attribute. - * This method is primarily necessary to load credentials from asynchronous - * sources, or sources that can refresh credentials periodically. - * @example Getting your access key - * AWS.config.getCredentials(function(err) { - * if (err) console.log(err.stack); // credentials not loaded - * else console.log("Access Key:", AWS.config.credentials.accessKeyId); - * }) - * @callback callback function(err) - * Called when the {credentials} have been properly set on the configuration - * object. - * - * @param err [Error] if this is set, credentials were not successfully - * loaded and this error provides information why. - * @see credentials - * @see Credentials - */ - getCredentials: function getCredentials(callback) { - var self = this; - - function finish(err) { - callback(err, err ? null : self.credentials); - } - - function credError(msg, err) { - return new AWS.util.error(err || new Error(), { - code: 'CredentialsError', - message: msg, - name: 'CredentialsError' - }); - } - - function getAsyncCredentials() { - self.credentials.get(function(err) { - if (err) { - var msg = 'Could not load credentials from ' + - self.credentials.constructor.name; - err = credError(msg, err); - } - finish(err); - }); - } - - function getStaticCredentials() { - var err = null; - if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { - err = credError('Missing credentials'); - } - finish(err); - } - - if (self.credentials) { - if (typeof self.credentials.get === 'function') { - getAsyncCredentials(); - } else { // static credentials - getStaticCredentials(); - } - } else if (self.credentialProvider) { - self.credentialProvider.resolve(function(err, creds) { - if (err) { - err = credError('Could not load credentials from any providers', err); - } - self.credentials = creds; - finish(err); - }); - } else { - finish(credError('No credentials to load')); - } - }, - - /** - * @!group Loading and Setting Configuration Options - */ - - /** - * @overload update(options, allowUnknownKeys = false) - * Updates the current configuration object with new options. - * - * @example Update maxRetries property of a configuration object - * config.update({maxRetries: 10}); - * @param [Object] options a map of option keys and values. - * @param [Boolean] allowUnknownKeys whether unknown keys can be set on - * the configuration object. Defaults to `false`. - * @see constructor - */ - update: function update(options, allowUnknownKeys) { - allowUnknownKeys = allowUnknownKeys || false; - options = this.extractCredentials(options); - AWS.util.each.call(this, options, function (key, value) { - if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || - AWS.Service.hasService(key)) { - this.set(key, value); - } - }); - }, - - /** - * Loads configuration data from a JSON file into this config object. - * @note Loading configuration will reset all existing configuration - * on the object. - * @!macro nobrowser - * @param path [String] the path relative to your process's current - * working directory to load configuration from. - * @return [AWS.Config] the same configuration object - */ - loadFromPath: function loadFromPath(path) { - this.clear(); - - var options = JSON.parse(AWS.util.readFileSync(path)); - var fileSystemCreds = new AWS.FileSystemCredentials(path); - var chain = new AWS.CredentialProviderChain(); - chain.providers.unshift(fileSystemCreds); - chain.resolve(function (err, creds) { - if (err) throw err; - else options.credentials = creds; - }); - - this.constructor(options); - - return this; - }, - - /** - * Clears configuration data on this object - * - * @api private - */ - clear: function clear() { - /*jshint forin:false */ - AWS.util.each.call(this, this.keys, function (key) { - delete this[key]; - }); - - // reset credential provider - this.set('credentials', undefined); - this.set('credentialProvider', undefined); - }, - - /** - * Sets a property on the configuration object, allowing for a - * default value - * @api private - */ - set: function set(property, value, defaultValue) { - if (value === undefined) { - if (defaultValue === undefined) { - defaultValue = this.keys[property]; - } - if (typeof defaultValue === 'function') { - this[property] = defaultValue.call(this); - } else { - this[property] = defaultValue; - } - } else if (property === 'httpOptions' && this[property]) { - // deep merge httpOptions - this[property] = AWS.util.merge(this[property], value); - } else { - this[property] = value; - } - }, - - /** - * All of the keys with their default values. - * - * @constant - * @api private - */ - keys: { - credentials: null, - credentialProvider: null, - region: null, - logger: null, - apiVersions: {}, - apiVersion: null, - endpoint: undefined, - httpOptions: { - timeout: 120000 - }, - maxRetries: undefined, - maxRedirects: 10, - paramValidation: true, - sslEnabled: true, - s3ForcePathStyle: false, - s3BucketEndpoint: false, - s3DisableBodySigning: true, - s3UsEast1RegionalEndpoint: 'legacy', - s3UseArnRegion: undefined, - computeChecksums: true, - convertResponseTypes: true, - correctClockSkew: false, - customUserAgent: null, - dynamoDbCrc32: true, - systemClockOffset: 0, - signatureVersion: null, - signatureCache: true, - retryDelayOptions: {}, - useAccelerateEndpoint: false, - clientSideMonitoring: false, - endpointDiscoveryEnabled: undefined, - endpointCacheSize: 1000, - hostPrefixEnabled: true, - stsRegionalEndpoints: 'legacy' - }, - - /** - * Extracts accessKeyId, secretAccessKey and sessionToken - * from a configuration hash. - * - * @api private - */ - extractCredentials: function extractCredentials(options) { - if (options.accessKeyId && options.secretAccessKey) { - options = AWS.util.copy(options); - options.credentials = new AWS.Credentials(options); - } - return options; - }, - - /** - * Sets the promise dependency the SDK will use wherever Promises are returned. - * Passing `null` will force the SDK to use native Promises if they are available. - * If native Promises are not available, passing `null` will have no effect. - * @param [Constructor] dep A reference to a Promise constructor - */ - setPromisesDependency: function setPromisesDependency(dep) { - PromisesDependency = dep; - // if null was passed in, we should try to use native promises - if (dep === null && typeof Promise === 'function') { - PromisesDependency = Promise; - } - var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; - if (AWS.S3) { - constructors.push(AWS.S3); - if (AWS.S3.ManagedUpload) { - constructors.push(AWS.S3.ManagedUpload); - } - } - AWS.util.addPromises(constructors, PromisesDependency); - }, - - /** - * Gets the promise dependency set by `AWS.config.setPromisesDependency`. - */ - getPromisesDependency: function getPromisesDependency() { - return PromisesDependency; - } -}); - -/** - * @return [AWS.Config] The global configuration object singleton instance - * @readonly - * @see AWS.Config - */ -AWS.config = new AWS.Config(); - - -/***/ }), -/* 188 */, -/* 189 */, -/* 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)); -} - - -/***/ }), -/* 191 */ -/***/ (function(module) { - -module.exports = require("querystring"); - -/***/ }), -/* 192 */, -/* 193 */, -/* 194 */, -/* 195 */, -/* 196 */, -/* 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 */, -/* 199 */, -/* 200 */ -/***/ (function(module) { - -module.exports = require("dgram"); - -/***/ }), -/* 201 */, -/* 202 */, -/* 203 */, -/* 204 */, -/* 205 */, -/* 206 */, -/* 207 */, -/* 208 */, -/* 209 */, -/* 210 */ -/***/ (function(__unusedmodule, exports) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - exports.stripBOM = function(str) { - if (str[0] === '\uFEFF') { - return str.substring(1); - } else { - return str; - } - }; - -}).call(this); - - -/***/ }), -/* 211 */ -/***/ (function(module) { - -module.exports = require("https"); - -/***/ }), -/* 212 */, -/* 213 */ -/***/ (function(module) { - -module.exports = require("timers"); - -/***/ }), -/* 214 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -__webpack_require__(234); -var AWS = __webpack_require__(395); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['cognitoidentity'] = {}; -AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); -__webpack_require__(382); -Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { - get: function get() { - var model = __webpack_require__(56); - model.paginators = __webpack_require__(371).pagination; - return model; - }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.CognitoIdentity; - - -/***/ }), -/* 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"}]}; - -/***/ }), -/* 216 */, -/* 217 */, -/* 218 */, -/* 219 */, -/* 220 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var AWS = __webpack_require__(395); -var inherit = AWS.util.inherit; - -/** - * @api private - */ -AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, { - addAuthorization: function addAuthorization(credentials, date) { - - if (!date) date = AWS.util.date.getDate(); - - var r = this.request; - - r.params.Timestamp = AWS.util.date.iso8601(date); - r.params.SignatureVersion = '2'; - r.params.SignatureMethod = 'HmacSHA256'; - r.params.AWSAccessKeyId = credentials.accessKeyId; - - if (credentials.sessionToken) { - r.params.SecurityToken = credentials.sessionToken; - } - - delete r.params.Signature; // delete old Signature for re-signing - r.params.Signature = this.signature(credentials); - - r.body = AWS.util.queryParamsToString(r.params); - r.headers['Content-Length'] = r.body.length; - }, - - signature: function signature(credentials) { - return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); - }, - - stringToSign: function stringToSign() { - var parts = []; - parts.push(this.request.method); - parts.push(this.request.endpoint.host.toLowerCase()); - parts.push(this.request.pathname()); - parts.push(AWS.util.queryParamsToString(this.request.params)); - return parts.join('\n'); - } - -}); - -/** - * @api private - */ -module.exports = AWS.Signers.V2; - - -/***/ }), -/* 221 */, -/* 222 */, -/* 223 */, -/* 224 */, -/* 225 */, -/* 226 */, -/* 227 */, -/* 228 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(945); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - - -/***/ }), -/* 229 */ -/***/ (function(module) { - -module.exports = require("domain"); - -/***/ }), -/* 230 */, -/* 231 */, -/* 232 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var AWS = __webpack_require__(395); -/** - * @api private - */ -function validateRegionalEndpointsFlagValue(configValue, errorOptions) { - if (typeof configValue !== 'string') return undefined; - else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { - return configValue.toLowerCase(); - } else { - throw AWS.util.error(new Error(), errorOptions); - } -} - -/** - * Resolve the configuration value for regional endpoint from difference sources: client - * config, environmental variable, shared config file. Value can be case-insensitive - * 'legacy' or 'reginal'. - * @param originalConfig user-supplied config object to resolve - * @param options a map of config property names from individual configuration source - * - env: name of environmental variable that refers to the config - * - sharedConfig: name of shared configuration file property that refers to the config - * - clientConfig: name of client configuration property that refers to the config - * - * @api private - */ -function resolveRegionalEndpointsFlag(originalConfig, options) { - originalConfig = originalConfig || {}; - //validate config value - var resolved; - if (originalConfig[options.clientConfig]) { - resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { - code: 'InvalidConfiguration', - message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + - ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' - }); - if (resolved) return resolved; - } - if (!AWS.util.isNode()) return resolved; - //validate environmental variable - if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { - var envFlag = process.env[options.env]; - resolved = validateRegionalEndpointsFlagValue(envFlag, { - code: 'InvalidEnvironmentalVariable', - message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + - ' or "regional". Got "' + process.env[options.env] + '".' - }); - if (resolved) return resolved; - } - //validate shared config file - var profile = {}; - try { - var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); - profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; - } catch (e) {}; - if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { - var fileFlag = profile[options.sharedConfig]; - resolved = validateRegionalEndpointsFlagValue(fileFlag, { - code: 'InvalidConfiguration', - message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + - ' or "regional". Got "' + profile[options.sharedConfig] + '".' - }); - if (resolved) return resolved; - } - return resolved; -} - -module.exports = resolveRegionalEndpointsFlag; - - -/***/ }), -/* 233 */, -/* 234 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var util = __webpack_require__(153); - -util.isBrowser = function() { return false; }; -util.isNode = function() { return true; }; - -// node.js specific modules -util.crypto.lib = __webpack_require__(373); -util.Buffer = __webpack_require__(407).Buffer; -util.domain = __webpack_require__(229); -util.stream = __webpack_require__(413); -util.url = __webpack_require__(835); -util.querystring = __webpack_require__(191); -util.environment = 'nodejs'; -util.createEventStream = util.stream.Readable ? - __webpack_require__(445).createEventStream : __webpack_require__(661).createEventStream; -util.realClock = __webpack_require__(693); -util.clientSideMonitoring = { - Publisher: __webpack_require__(701).Publisher, - configProvider: __webpack_require__(762), -}; -util.iniLoader = __webpack_require__(892).iniLoader; - -var AWS; - -/** - * @api private - */ -module.exports = AWS = __webpack_require__(395); - -__webpack_require__(923); -__webpack_require__(906); -__webpack_require__(437); -__webpack_require__(543); -__webpack_require__(306); -__webpack_require__(170); -__webpack_require__(540); -__webpack_require__(982); - -// Load the xml2js XML parser -AWS.XML.Parser = __webpack_require__(810); - -// Load Node HTTP client -__webpack_require__(888); - -__webpack_require__(960); - -// Load custom credential providers -__webpack_require__(868); -__webpack_require__(103); -__webpack_require__(426); -__webpack_require__(316); -__webpack_require__(872); -__webpack_require__(634); -__webpack_require__(22); -__webpack_require__(982); - -// Setup default chain providers -// If this changes, please update documentation for -// AWS.CredentialProviderChain.defaultProviders in -// credentials/credential_provider_chain.js -AWS.CredentialProviderChain.defaultProviders = [ - function () { return new AWS.EnvironmentCredentials('AWS'); }, - function () { return new AWS.EnvironmentCredentials('AMAZON'); }, - function () { return new AWS.SharedIniFileCredentials(); }, - function () { return new AWS.ECSCredentials(); }, - function () { return new AWS.ProcessCredentials(); }, - function () { return new AWS.TokenFileWebIdentityCredentials(); }, - function () { return new AWS.EC2MetadataCredentials(); } -]; - -// Update configuration keys -AWS.util.update(AWS.Config.prototype.keys, { - credentials: function () { - var credentials = null; - new AWS.CredentialProviderChain([ - function () { return new AWS.EnvironmentCredentials('AWS'); }, - function () { return new AWS.EnvironmentCredentials('AMAZON'); }, - function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } - ]).resolve(function(err, creds) { - if (!err) credentials = creds; - }); - return credentials; - }, - credentialProvider: function() { - return new AWS.CredentialProviderChain(); - }, - logger: function () { - return process.env.AWSJS_DEBUG ? console : null; - }, - region: function() { - var env = process.env; - var region = env.AWS_REGION || env.AMAZON_REGION; - if (env[AWS.util.configOptInEnv]) { - var toCheck = [ - {filename: env[AWS.util.sharedCredentialsFileEnv]}, - {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} - ]; - var iniLoader = AWS.util.iniLoader; - while (!region && toCheck.length) { - var configFile = iniLoader.loadFrom(toCheck.shift()); - var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; - region = profile && profile.region; - } - } - return region; - } -}); - -// Reset configuration -AWS.config = new AWS.Config(); - - -/***/ }), -/* 235 */, -/* 236 */, -/* 237 */, -/* 238 */, -/* 239 */, -/* 240 */, -/* 241 */, -/* 242 */, -/* 243 */, -/* 244 */, -/* 245 */, -/* 246 */, -/* 247 */, -/* 248 */, -/* 249 */, -/* 250 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -var deprecation = __webpack_require__(692); - -var endpointsByScope = { - actions: { - cancelWorkflowRun: { + 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: { @@ -6137,26 +2531,716 @@ var endpointsByScope = { required: true, type: "string" }, - run_id: { + 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: "/repos/:owner/:repo/actions/runs/:run_id/cancel" + url: "/user/installations/:installation_id/repositories/:repository_id" }, - createOrUpdateSecretForRepo: { - method: "PUT", + checkAccountIsAssociatedWithAny: { + method: "GET", params: { - encrypted_value: { + 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" }, - key_id: { + 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" }, - name: { + 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" @@ -6166,171 +3250,453 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/actions/secrets/:name" + url: "/repos/:owner/:repo/installation" }, - createRegistrationToken: { + 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: { - owner: { - required: true, + 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" }, - repo: { + client_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/runners/registration-token" + url: "/applications/:client_id/token" }, - createRemoveToken: { - method: "POST", + 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: { - owner: { + access_token: { required: true, type: "string" }, - repo: { + client_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/runners/remove-token" + url: "/applications/:client_id/tokens/:access_token" }, - deleteArtifact: { + 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: { - artifact_id: { - required: true, - type: "integer" - }, - owner: { + access_token: { required: true, type: "string" }, - repo: { + client_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id" + url: "/applications/:client_id/grants/:access_token" }, - deleteSecretFromRepo: { + 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: { - name: { + actions: { + type: "object[]" + }, + "actions[].description": { required: true, type: "string" }, - owner: { + "actions[].identifier": { required: true, type: "string" }, - repo: { + "actions[].label": { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/:name" - }, - downloadArtifact: { - method: "GET", - params: { - archive_format: { - required: true, + }, + completed_at: { type: "string" }, - artifact_id: { - required: true, - type: "integer" + conclusion: { + enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"], + type: "string" }, - owner: { - required: true, + details_url: { type: "string" }, - repo: { - required: true, + external_id: { type: "string" - } - }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format" - }, - getArtifact: { - method: "GET", - params: { - artifact_id: { - required: true, - type: "integer" }, - owner: { + head_sha: { required: true, type: "string" }, - repo: { + name: { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id" - }, - getPublicKey: { - method: "GET", - params: { - owner: { + }, + output: { + type: "object" + }, + "output.annotations": { + type: "object[]" + }, + "output.annotations[].annotation_level": { + enum: ["notice", "warning", "failure"], required: true, type: "string" }, - repo: { + "output.annotations[].end_column": { + type: "integer" + }, + "output.annotations[].end_line": { required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/public-key" - }, - getSecret: { - method: "GET", - params: { - name: { + type: "integer" + }, + "output.annotations[].message": { required: true, type: "string" }, - owner: { + "output.annotations[].path": { required: true, type: "string" }, - page: { + "output.annotations[].raw_details": { + type: "string" + }, + "output.annotations[].start_column": { type: "integer" }, - per_page: { + "output.annotations[].start_line": { + required: true, type: "integer" }, - repo: { + "output.annotations[].title": { + type: "string" + }, + "output.images": { + type: "object[]" + }, + "output.images[].alt": { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/actions/secrets/:name" - }, - getSelfHostedRunner: { - method: "GET", - params: { - owner: { + }, + "output.images[].caption": { + type: "string" + }, + "output.images[].image_url": { required: true, type: "string" }, - repo: { + "output.summary": { required: true, type: "string" }, - runner_id: { + "output.text": { + type: "string" + }, + "output.title": { required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runners/:runner_id" - }, - getWorkflow: { - method: "GET", - params: { + type: "string" + }, owner: { required: true, type: "string" @@ -6339,19 +3705,25 @@ var endpointsByScope = { required: true, type: "string" }, - workflow_id: { - required: true, - type: "integer" + started_at: { + type: "string" + }, + status: { + enum: ["queued", "in_progress", "completed"], + type: "string" } }, - url: "/repos/:owner/:repo/actions/workflows/:workflow_id" + url: "/repos/:owner/:repo/check-runs" }, - getWorkflowJob: { - method: "GET", + createSuite: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, + method: "POST", params: { - job_id: { + head_sha: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -6362,11 +3734,18 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/actions/jobs/:job_id" + url: "/repos/:owner/:repo/check-suites" }, - getWorkflowRun: { + get: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, method: "GET", params: { + check_run_id: { + required: true, + type: "integer" + }, owner: { required: true, type: "string" @@ -6374,17 +3753,20 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - run_id: { - required: true, - type: "integer" } }, - url: "/repos/:owner/:repo/actions/runs/:run_id" + url: "/repos/:owner/:repo/check-runs/:check_run_id" }, - listDownloadsForSelfHostedRunnerApplication: { + getSuite: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, method: "GET", params: { + check_suite_id: { + required: true, + type: "integer" + }, owner: { required: true, type: "string" @@ -6394,11 +3776,18 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/actions/runners/downloads" + url: "/repos/:owner/:repo/check-suites/:check_suite_id" }, - listJobsForWorkflowRun: { + listAnnotations: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, method: "GET", params: { + check_run_id: { + required: true, + type: "integer" + }, owner: { required: true, type: "string" @@ -6412,24 +3801,21 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - run_id: { - required: true, - type: "integer" } }, - url: "/repos/:owner/:repo/actions/runs/:run_id/jobs" + url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations" }, - listRepoWorkflowRuns: { + listForRef: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, method: "GET", params: { - actor: { - type: "string" - }, - branch: { + check_name: { type: "string" }, - event: { + filter: { + enum: ["latest", "all"], type: "string" }, owner: { @@ -6442,20 +3828,38 @@ var endpointsByScope = { per_page: { type: "integer" }, + ref: { + required: true, + type: "string" + }, repo: { required: true, type: "string" }, status: { - enum: ["completed", "status", "conclusion"], + enum: ["queued", "in_progress", "completed"], type: "string" } }, - url: "/repos/:owner/:repo/actions/runs" + url: "/repos/:owner/:repo/commits/:ref/check-runs" }, - listRepoWorkflows: { + 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" @@ -6469,13 +3873,26 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + status: { + enum: ["queued", "in_progress", "completed"], + type: "string" } }, - url: "/repos/:owner/:repo/actions/workflows" + url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs" }, - listSecretsForRepo: { + 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" @@ -6486,144 +3903,208 @@ var endpointsByScope = { per_page: { type: "integer" }, + ref: { + required: true, + type: "string" + }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/secrets" + url: "/repos/:owner/:repo/commits/:ref/check-suites" }, - listSelfHostedRunnersForRepo: { - method: "GET", + rerequestSuite: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, + method: "POST", params: { - owner: { + check_suite_id: { required: true, - type: "string" - }, - page: { type: "integer" }, - per_page: { - type: "integer" + owner: { + required: true, + type: "string" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/runners" + url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest" }, - listWorkflowJobLogs: { - method: "GET", + setSuitesPreferences: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, + method: "PATCH", params: { - job_id: { + 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" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/actions/jobs/:job_id/logs" + url: "/repos/:owner/:repo/check-suites/preferences" }, - listWorkflowRunArtifacts: { - method: "GET", + update: { + headers: { + accept: "application/vnd.github.antiope-preview+json" + }, + method: "PATCH", params: { - owner: { + actions: { + type: "object[]" + }, + "actions[].description": { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + "actions[].identifier": { + required: true, + type: "string" }, - repo: { + "actions[].label": { required: true, type: "string" }, - run_id: { + check_run_id: { required: true, type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts" - }, - listWorkflowRunLogs: { - method: "GET", - params: { - owner: { + }, + 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" }, - page: { + "output.annotations[].end_column": { type: "integer" }, - per_page: { + "output.annotations[].end_line": { + required: true, type: "integer" }, - repo: { + "output.annotations[].message": { required: true, type: "string" }, - run_id: { + "output.annotations[].path": { required: true, + type: "string" + }, + "output.annotations[].raw_details": { + type: "string" + }, + "output.annotations[].start_column": { type: "integer" - } - }, - url: "/repos/:owner/:repo/actions/runs/:run_id/logs" - }, - listWorkflowRuns: { - method: "GET", - params: { - actor: { + }, + "output.annotations[].start_line": { + required: true, + type: "integer" + }, + "output.annotations[].title": { type: "string" }, - branch: { + "output.images": { + type: "object[]" + }, + "output.images[].alt": { + required: true, type: "string" }, - event: { + "output.images[].caption": { type: "string" }, - owner: { + "output.images[].image_url": { required: true, type: "string" }, - page: { - type: "integer" + "output.summary": { + required: true, + type: "string" }, - per_page: { - type: "integer" + "output.text": { + type: "string" + }, + "output.title": { + type: "string" + }, + owner: { + required: true, + type: "string" }, repo: { required: true, type: "string" }, - status: { - enum: ["completed", "status", "conclusion"], + started_at: { type: "string" }, - workflow_id: { + 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: "integer" + type: "string" } }, - url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs" + url: "/codes_of_conduct/:key" }, - reRunWorkflow: { - method: "POST", + getForRepo: { + headers: { + accept: "application/vnd.github.scarlet-witch-preview+json" + }, + method: "GET", params: { owner: { required: true, @@ -6632,162 +4113,148 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - run_id: { - required: true, - type: "integer" } }, - url: "/repos/:owner/:repo/actions/runs/:run_id/rerun" + 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" }, - removeSelfHostedRunner: { - method: "DELETE", + create: { + method: "POST", params: { - owner: { - required: true, + description: { type: "string" }, - repo: { + files: { required: true, + type: "object" + }, + "files.content": { type: "string" }, - runner_id: { - required: true, - type: "integer" + public: { + type: "boolean" } }, - url: "/repos/:owner/:repo/actions/runners/:runner_id" - } - }, - activity: { - checkStarringRepo: { - method: "GET", + url: "/gists" + }, + createComment: { + method: "POST", params: { - owner: { + body: { required: true, type: "string" }, - repo: { + gist_id: { required: true, type: "string" } }, - url: "/user/starred/:owner/:repo" + url: "/gists/:gist_id/comments" }, - deleteRepoSubscription: { + delete: { method: "DELETE", params: { - owner: { - required: true, - type: "string" - }, - repo: { + gist_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/subscription" + url: "/gists/:gist_id" }, - deleteThreadSubscription: { + deleteComment: { method: "DELETE", params: { - thread_id: { + comment_id: { required: true, type: "integer" - } - }, - url: "/notifications/threads/:thread_id/subscription" - }, - getRepoSubscription: { - method: "GET", - params: { - owner: { - required: true, - type: "string" }, - repo: { + gist_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/subscription" + url: "/gists/:gist_id/comments/:comment_id" }, - getThread: { - method: "GET", + fork: { + method: "POST", params: { - thread_id: { + gist_id: { required: true, - type: "integer" + type: "string" } }, - url: "/notifications/threads/:thread_id" + url: "/gists/:gist_id/forks" }, - getThreadSubscription: { + get: { method: "GET", params: { - thread_id: { + gist_id: { required: true, - type: "integer" + type: "string" } }, - url: "/notifications/threads/:thread_id/subscription" + url: "/gists/:gist_id" }, - listEventsForOrg: { + getComment: { method: "GET", params: { - org: { + comment_id: { required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { type: "integer" }, - username: { + gist_id: { required: true, type: "string" } }, - url: "/users/:username/events/orgs/:org" + url: "/gists/:gist_id/comments/:comment_id" }, - listEventsForUser: { + getRevision: { method: "GET", params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" + gist_id: { + required: true, + type: "string" }, - username: { + sha: { required: true, type: "string" } }, - url: "/users/:username/events" - }, - listFeeds: { - method: "GET", - params: {}, - url: "/feeds" + url: "/gists/:gist_id/:sha" }, - listNotifications: { + list: { method: "GET", params: { - all: { - type: "boolean" - }, - before: { - type: "string" - }, page: { type: "integer" }, - participating: { - type: "boolean" - }, per_page: { type: "integer" }, @@ -6795,43 +4262,15 @@ var endpointsByScope = { type: "string" } }, - url: "/notifications" + url: "/gists" }, - listNotificationsForRepo: { + listComments: { 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: { + gist_id: { required: true, type: "string" }, - since: { - type: "string" - } - }, - url: "/repos/:owner/:repo/notifications" - }, - listPublicEvents: { - method: "GET", - params: { page: { type: "integer" }, @@ -6839,12 +4278,12 @@ var endpointsByScope = { type: "integer" } }, - url: "/events" + url: "/gists/:gist_id/comments" }, - listPublicEventsForOrg: { + listCommits: { method: "GET", params: { - org: { + gist_id: { required: true, type: "string" }, @@ -6855,12 +4294,12 @@ var endpointsByScope = { type: "integer" } }, - url: "/orgs/:org/events" + url: "/gists/:gist_id/commits" }, - listPublicEventsForRepoNetwork: { + listForks: { method: "GET", params: { - owner: { + gist_id: { required: true, type: "string" }, @@ -6869,15 +4308,11 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - repo: { - required: true, - type: "string" } }, - url: "/networks/:owner/:repo/events" + url: "/gists/:gist_id/forks" }, - listPublicEventsForUser: { + listPublic: { method: "GET", params: { page: { @@ -6886,14 +4321,13 @@ var endpointsByScope = { per_page: { type: "integer" }, - username: { - required: true, + since: { type: "string" } }, - url: "/users/:username/events/public" + url: "/gists/public" }, - listReceivedEventsForUser: { + listPublicForUser: { method: "GET", params: { page: { @@ -6902,14 +4336,17 @@ var endpointsByScope = { per_page: { type: "integer" }, + since: { + type: "string" + }, username: { required: true, type: "string" } }, - url: "/users/:username/received_events" + url: "/users/:username/gists" }, - listReceivedPublicEventsForUser: { + listStarred: { method: "GET", params: { page: { @@ -6918,431 +4355,277 @@ var endpointsByScope = { per_page: { type: "integer" }, - username: { - required: true, + since: { type: "string" } }, - url: "/users/:username/received_events/public" + url: "/gists/starred" }, - listRepoEvents: { - method: "GET", + star: { + method: "PUT", params: { - owner: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { + gist_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/events" + url: "/gists/:gist_id/star" }, - listReposStarredByAuthenticatedUser: { - method: "GET", + unstar: { + method: "DELETE", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - sort: { - enum: ["created", "updated"], + gist_id: { + required: true, type: "string" } }, - url: "/user/starred" + url: "/gists/:gist_id/star" }, - listReposStarredByUser: { - method: "GET", + update: { + method: "PATCH", params: { - direction: { - enum: ["asc", "desc"], + description: { type: "string" }, - page: { - type: "integer" + files: { + type: "object" }, - per_page: { - type: "integer" + "files.content": { + type: "string" }, - sort: { - enum: ["created", "updated"], + "files.filename": { type: "string" }, - username: { + gist_id: { required: true, type: "string" } }, - url: "/users/:username/starred" + url: "/gists/:gist_id" }, - listReposWatchedByUser: { - method: "GET", + updateComment: { + method: "PATCH", params: { - page: { - type: "integer" + body: { + required: true, + type: "string" }, - per_page: { + comment_id: { + required: true, type: "integer" }, - username: { + gist_id: { required: true, type: "string" } }, - url: "/users/:username/subscriptions" - }, - listStargazersForRepo: { - method: "GET", + url: "/gists/:gist_id/comments/:comment_id" + } + }, + git: { + createBlob: { + method: "POST", params: { - owner: { + content: { required: true, type: "string" }, - page: { - type: "integer" + encoding: { + type: "string" }, - per_page: { - type: "integer" + owner: { + required: true, + type: "string" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/stargazers" + url: "/repos/:owner/:repo/git/blobs" }, - listWatchedReposForAuthenticatedUser: { - method: "GET", + createCommit: { + method: "POST", params: { - page: { - type: "integer" + author: { + type: "object" }, - per_page: { - type: "integer" - } - }, - url: "/user/subscriptions" - }, - listWatchersForRepo: { - method: "GET", - params: { - owner: { - required: true, + "author.date": { type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + "author.email": { + type: "string" }, - repo: { - required: true, + "author.name": { type: "string" - } - }, - url: "/repos/:owner/:repo/subscribers" - }, - markAsRead: { - method: "PUT", - params: { - last_read_at: { + }, + committer: { + type: "object" + }, + "committer.date": { type: "string" - } - }, - url: "/notifications" - }, - markNotificationsAsReadForRepo: { - method: "PUT", - params: { - last_read_at: { + }, + "committer.email": { type: "string" }, - owner: { - required: true, + "committer.name": { type: "string" }, - repo: { + message: { 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" }, + parents: { + required: true, + type: "string[]" + }, repo: { required: true, type: "string" }, - subscribed: { - type: "boolean" - } - }, - url: "/repos/:owner/:repo/subscription" - }, - setThreadSubscription: { - method: "PUT", - params: { - ignored: { - type: "boolean" + signature: { + type: "string" }, - thread_id: { + tree: { required: true, - type: "integer" + type: "string" } }, - url: "/notifications/threads/:thread_id/subscription" + url: "/repos/:owner/:repo/git/commits" }, - starRepo: { - method: "PUT", + createRef: { + method: "POST", params: { owner: { required: true, type: "string" }, - repo: { - required: true, - type: "string" - } - }, - url: "/user/starred/:owner/:repo" - }, - unstarRepo: { - method: "DELETE", - params: { - owner: { + ref: { 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: { + sha: { required: true, - type: "integer" + type: "string" } }, - url: "/marketplace_listing/stubbed/accounts/:account_id" + url: "/repos/:owner/:repo/git/refs" }, - checkAuthorization: { - deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization", - method: "GET", + createTag: { + method: "POST", params: { - access_token: { + message: { required: true, type: "string" }, - client_id: { + object: { 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: { + owner: { required: true, type: "string" - } - }, - url: "/applications/:client_id/token" - }, - createContentAttachment: { - headers: { - accept: "application/vnd.github.corsair-preview+json" - }, - method: "POST", - params: { - body: { + }, + repo: { required: true, type: "string" }, - content_reference_id: { + tag: { required: true, - type: "integer" + type: "string" }, - title: { + 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: "/content_references/:content_reference_id/attachments" + url: "/repos/:owner/:repo/git/tags" }, - createFromManifest: { - headers: { - accept: "application/vnd.github.fury-preview+json" - }, + createTree: { method: "POST", params: { - code: { + base_tree: { + type: "string" + }, + owner: { required: true, type: "string" - } - }, - url: "/app-manifests/:code/conversions" - }, - createInstallationToken: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "POST", - params: { - installation_id: { + }, + repo: { required: true, - type: "integer" + type: "string" }, - permissions: { - type: "object" + tree: { + required: true, + 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: { + "tree[].content": { type: "string" }, - client_id: { - required: true, + "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: "/applications/:client_id/grant" + url: "/repos/:owner/:repo/git/trees" }, - deleteInstallation: { - headers: { - accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json" - }, + deleteRef: { method: "DELETE", params: { - installation_id: { + owner: { 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: { + ref: { 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: { + }, + repo: { required: true, type: "string" } }, - url: "/orgs/:org/installation" + url: "/repos/:owner/:repo/git/refs/:ref" }, - findRepoInstallation: { - deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)", - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + getBlob: { method: "GET", params: { + file_sha: { + required: true, + type: "string" + }, owner: { required: true, type: "string" @@ -7352,73 +4635,45 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/installation" + url: "/repos/:owner/:repo/git/blobs/:file_sha" }, - findUserInstallation: { - deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)", - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + getCommit: { method: "GET", params: { - username: { + commit_sha: { 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: { + }, + owner: { required: true, type: "string" - } - }, - url: "/apps/:app_slug" - }, - getInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - installation_id: { + }, + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/app/installations/:installation_id" + url: "/repos/:owner/:repo/git/commits/:commit_sha" }, - getOrgInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + getRef: { method: "GET", params: { - org: { + owner: { + required: true, + type: "string" + }, + ref: { + required: true, + type: "string" + }, + repo: { required: true, type: "string" } }, - url: "/orgs/:org/installation" + url: "/repos/:owner/:repo/git/ref/:ref" }, - getRepoInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + getTag: { method: "GET", params: { owner: { @@ -7428,52 +4683,41 @@ var endpointsByScope = { repo: { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/installation" - }, - getUserInstallation: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", - params: { - username: { + }, + tag_sha: { required: true, type: "string" } }, - url: "/users/:username/installation" + url: "/repos/:owner/:repo/git/tags/:tag_sha" }, - listAccountsUserOrOrgOnPlan: { + getTree: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], + owner: { + required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { + recursive: { + enum: ["1"], type: "integer" }, - plan_id: { + repo: { required: true, - type: "integer" + type: "string" }, - sort: { - enum: ["created", "updated"], + tree_sha: { + required: true, type: "string" } }, - url: "/marketplace_listing/plans/:plan_id/accounts" + url: "/repos/:owner/:repo/git/trees/:tree_sha" }, - listAccountsUserOrOrgOnPlanStubbed: { + listMatchingRefs: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], + owner: { + required: true, type: "string" }, page: { @@ -7482,320 +4726,328 @@ var endpointsByScope = { per_page: { type: "integer" }, - plan_id: { + ref: { required: true, - type: "integer" + type: "string" }, - sort: { - enum: ["created", "updated"], + repo: { + required: true, type: "string" } }, - url: "/marketplace_listing/stubbed/plans/:plan_id/accounts" + url: "/repos/:owner/:repo/git/matching-refs/:ref" }, - listInstallationReposForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + listRefs: { method: "GET", params: { - installation_id: { + namespace: { + type: "string" + }, + owner: { required: true, - type: "integer" + type: "string" }, 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" + repo: { + required: true, + type: "string" } }, - url: "/app/installations" + url: "/repos/:owner/:repo/git/refs/:namespace" }, - listInstallationsForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, - method: "GET", + updateRef: { + method: "PATCH", params: { - page: { - type: "integer" + force: { + type: "boolean" }, - per_page: { - type: "integer" - } - }, - url: "/user/installations" - }, - listMarketplacePurchasesForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" + owner: { + required: true, + type: "string" }, - per_page: { - type: "integer" - } - }, - url: "/user/marketplace_purchases" - }, - listMarketplacePurchasesForAuthenticatedUserStubbed: { - method: "GET", - params: { - page: { - type: "integer" + ref: { + required: true, + type: "string" }, - per_page: { - type: "integer" - } - }, - url: "/user/marketplace_purchases/stubbed" - }, - listPlans: { - method: "GET", - params: { - page: { - type: "integer" + repo: { + required: true, + type: "string" }, - per_page: { - type: "integer" + sha: { + required: true, + type: "string" } }, - url: "/marketplace_listing/plans" - }, - listPlansStubbed: { + url: "/repos/:owner/:repo/git/refs/:ref" + } + }, + gitignore: { + getTemplate: { method: "GET", params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" + name: { + required: true, + type: "string" } }, - url: "/marketplace_listing/stubbed/plans" + url: "/gitignore/templates/:name" }, - listRepos: { + listTemplates: { + method: "GET", + params: {}, + url: "/gitignore/templates" + } + }, + interactions: { + addOrUpdateRestrictionsForOrg: { headers: { - accept: "application/vnd.github.machine-man-preview+json" + accept: "application/vnd.github.sombra-preview+json" }, - method: "GET", + method: "PUT", params: { - page: { - type: "integer" + limit: { + enum: ["existing_users", "contributors_only", "collaborators_only"], + required: true, + type: "string" }, - per_page: { - type: "integer" + org: { + required: true, + type: "string" } }, - url: "/installation/repositories" + url: "/orgs/:org/interaction-limits" }, - removeRepoFromInstallation: { + addOrUpdateRestrictionsForRepo: { headers: { - accept: "application/vnd.github.machine-man-preview+json" + accept: "application/vnd.github.sombra-preview+json" }, - method: "DELETE", + method: "PUT", params: { - installation_id: { + limit: { + enum: ["existing_users", "contributors_only", "collaborators_only"], required: true, - type: "integer" + type: "string" }, - repository_id: { + owner: { required: true, - type: "integer" + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/user/installations/:installation_id/repositories/:repository_id" + url: "/repos/:owner/:repo/interaction-limits" }, - resetAuthorization: { - deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization", - method: "POST", + getRestrictionsForOrg: { + headers: { + accept: "application/vnd.github.sombra-preview+json" + }, + method: "GET", params: { - access_token: { - required: true, - type: "string" - }, - client_id: { + org: { required: true, type: "string" } }, - url: "/applications/:client_id/tokens/:access_token" + url: "/orgs/:org/interaction-limits" }, - resetToken: { + getRestrictionsForRepo: { headers: { - accept: "application/vnd.github.doctor-strange-preview+json" + accept: "application/vnd.github.sombra-preview+json" }, - method: "PATCH", + method: "GET", params: { - access_token: { + owner: { + required: true, type: "string" }, - client_id: { + repo: { required: true, type: "string" } }, - url: "/applications/:client_id/token" + url: "/repos/:owner/:repo/interaction-limits" }, - revokeAuthorizationForApplication: { - deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application", + removeRestrictionsForOrg: { + headers: { + accept: "application/vnd.github.sombra-preview+json" + }, method: "DELETE", params: { - access_token: { - required: true, - type: "string" - }, - client_id: { + org: { required: true, type: "string" } }, - url: "/applications/:client_id/tokens/:access_token" + url: "/orgs/:org/interaction-limits" }, - revokeGrantForApplication: { - deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application", + removeRestrictionsForRepo: { + headers: { + accept: "application/vnd.github.sombra-preview+json" + }, method: "DELETE", params: { - access_token: { + owner: { required: true, type: "string" }, - client_id: { + repo: { 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" + url: "/repos/:owner/:repo/interaction-limits" } }, - checks: { - create: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, + issues: { + addAssignees: { method: "POST", params: { - actions: { - type: "object[]" + assignees: { + type: "string[]" }, - "actions[].description": { + issue_number: { required: true, - type: "string" + type: "integer" }, - "actions[].identifier": { + number: { + alias: "issue_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - "actions[].label": { + repo: { required: true, type: "string" + } + }, + url: "/repos/:owner/:repo/issues/:issue_number/assignees" + }, + addLabels: { + method: "POST", + params: { + issue_number: { + required: true, + type: "integer" }, - completed_at: { - type: "string" + labels: { + required: true, + type: "string[]" }, - conclusion: { - enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"], - type: "string" + number: { + alias: "issue_number", + deprecated: true, + type: "integer" }, - details_url: { + owner: { + required: true, type: "string" }, - external_id: { + repo: { + required: true, + type: "string" + } + }, + url: "/repos/:owner/:repo/issues/:issue_number/labels" + }, + checkAssignee: { + method: "GET", + params: { + assignee: { + required: true, type: "string" }, - head_sha: { + owner: { required: true, type: "string" }, - name: { + repo: { required: true, type: "string" + } + }, + url: "/repos/:owner/:repo/assignees/:assignee" + }, + create: { + method: "POST", + params: { + assignee: { + type: "string" }, - output: { - type: "object" - }, - "output.annotations": { - type: "object[]" + assignees: { + type: "string[]" }, - "output.annotations[].annotation_level": { - enum: ["notice", "warning", "failure"], - required: true, + body: { type: "string" }, - "output.annotations[].end_column": { - type: "integer" + labels: { + type: "string[]" }, - "output.annotations[].end_line": { - required: true, + milestone: { type: "integer" }, - "output.annotations[].message": { + owner: { required: true, type: "string" }, - "output.annotations[].path": { + repo: { required: true, type: "string" }, - "output.annotations[].raw_details": { + title: { + required: true, + type: "string" + } + }, + url: "/repos/:owner/:repo/issues" + }, + createComment: { + method: "POST", + params: { + body: { + required: true, type: "string" }, - "output.annotations[].start_column": { - type: "integer" - }, - "output.annotations[].start_line": { + issue_number: { required: true, type: "integer" }, - "output.annotations[].title": { - type: "string" - }, - "output.images": { - type: "object[]" + number: { + alias: "issue_number", + deprecated: true, + type: "integer" }, - "output.images[].alt": { + owner: { required: true, type: "string" }, - "output.images[].caption": { - type: "string" - }, - "output.images[].image_url": { + repo: { required: true, type: "string" - }, - "output.summary": { + } + }, + url: "/repos/:owner/:repo/issues/:issue_number/comments" + }, + createLabel: { + method: "POST", + params: { + color: { required: true, type: "string" }, - "output.text": { + description: { type: "string" }, - "output.title": { + name: { required: true, type: "string" }, @@ -7806,25 +5058,17 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - started_at: { - type: "string" - }, - status: { - enum: ["queued", "in_progress", "completed"], - type: "string" } }, - url: "/repos/:owner/:repo/check-runs" + url: "/repos/:owner/:repo/labels" }, - createSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, + createMilestone: { method: "POST", params: { - head_sha: { - required: true, + description: { + type: "string" + }, + due_on: { type: "string" }, owner: { @@ -7834,17 +5078,22 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + state: { + enum: ["open", "closed"], + type: "string" + }, + title: { + required: true, + type: "string" } }, - url: "/repos/:owner/:repo/check-suites" + url: "/repos/:owner/:repo/milestones" }, - get: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", + deleteComment: { + method: "DELETE", params: { - check_run_id: { + comment_id: { required: true, type: "integer" }, @@ -7857,17 +5106,14 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/check-runs/:check_run_id" + url: "/repos/:owner/:repo/issues/comments/:comment_id" }, - getSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", + deleteLabel: { + method: "DELETE", params: { - check_suite_id: { + name: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -7878,134 +5124,80 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/check-suites/:check_suite_id" + url: "/repos/:owner/:repo/labels/:name" }, - listAnnotations: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "GET", + deleteMilestone: { + method: "DELETE", params: { - check_run_id: { + 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/check-runs/:check_run_id/annotations" + url: "/repos/:owner/:repo/milestones/:milestone_number" }, - listForRef: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, + get: { method: "GET", params: { - check_name: { - type: "string" - }, - filter: { - enum: ["latest", "all"], - type: "string" - }, - owner: { + issue_number: { required: true, - type: "string" - }, - page: { type: "integer" }, - per_page: { + number: { + alias: "issue_number", + deprecated: true, type: "integer" }, - ref: { + owner: { 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" + url: "/repos/:owner/:repo/issues/:issue_number" }, - listForSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, + getComment: { method: "GET", params: { - check_name: { - type: "string" - }, - check_suite_id: { + comment_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" + url: "/repos/:owner/:repo/issues/comments/:comment_id" }, - listSuitesForRef: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, + getEvent: { method: "GET", params: { - app_id: { - type: "integer" - }, - check_name: { - type: "string" - }, - owner: { + event_id: { required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { type: "integer" }, - ref: { + owner: { required: true, type: "string" }, @@ -8014,17 +5206,14 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/commits/:ref/check-suites" + url: "/repos/:owner/:repo/issues/events/:event_id" }, - rerequestSuite: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "POST", + getLabel: { + method: "GET", params: { - check_suite_id: { + name: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -8035,24 +5224,19 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest" + url: "/repos/:owner/:repo/labels/:name" }, - setSuitesPreferences: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "PATCH", + getMilestone: { + method: "GET", params: { - auto_trigger_checks: { - type: "object[]" - }, - "auto_trigger_checks[].app_id": { + milestone_number: { required: true, type: "integer" }, - "auto_trigger_checks[].setting": { - required: true, - type: "boolean" + number: { + alias: "milestone_number", + deprecated: true, + type: "integer" }, owner: { required: true, @@ -8063,297 +5247,214 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/check-suites/preferences" + url: "/repos/:owner/:repo/milestones/:milestone_number" }, - update: { - headers: { - accept: "application/vnd.github.antiope-preview+json" - }, - method: "PATCH", + list: { + method: "GET", params: { - actions: { - type: "object[]" - }, - "actions[].description": { - required: true, + direction: { + enum: ["asc", "desc"], type: "string" }, - "actions[].identifier": { - required: true, + filter: { + enum: ["assigned", "created", "mentioned", "subscribed", "all"], type: "string" }, - "actions[].label": { - required: true, + labels: { type: "string" }, - check_run_id: { - required: true, + page: { type: "integer" }, - completed_at: { - type: "string" - }, - conclusion: { - enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"], - type: "string" + per_page: { + type: "integer" }, - details_url: { + since: { type: "string" }, - external_id: { + sort: { + enum: ["created", "updated", "comments"], type: "string" }, - name: { + state: { + enum: ["open", "closed", "all"], type: "string" - }, - output: { - type: "object" - }, - "output.annotations": { - type: "object[]" - }, - "output.annotations[].annotation_level": { - enum: ["notice", "warning", "failure"], + } + }, + url: "/issues" + }, + listAssignees: { + method: "GET", + params: { + owner: { required: true, type: "string" }, - "output.annotations[].end_column": { + page: { type: "integer" }, - "output.annotations[].end_line": { - required: true, + per_page: { type: "integer" }, - "output.annotations[].message": { + repo: { required: true, type: "string" - }, - "output.annotations[].path": { + } + }, + url: "/repos/:owner/:repo/assignees" + }, + listComments: { + method: "GET", + params: { + issue_number: { required: true, - type: "string" - }, - "output.annotations[].raw_details": { - type: "string" - }, - "output.annotations[].start_column": { type: "integer" }, - "output.annotations[].start_line": { - required: true, + number: { + alias: "issue_number", + deprecated: 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": { + owner: { required: true, type: "string" }, - "output.text": { - type: "string" - }, - "output.title": { - type: "string" + page: { + type: "integer" }, - owner: { - required: true, - type: "string" + per_page: { + type: "integer" }, 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, + since: { type: "string" } }, - url: "/codes_of_conduct/:key" + url: "/repos/:owner/:repo/issues/:issue_number/comments" }, - getForRepo: { - headers: { - accept: "application/vnd.github.scarlet-witch-preview+json" - }, + listCommentsForRepo: { method: "GET", params: { - owner: { - required: true, + direction: { + enum: ["asc", "desc"], 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: { + owner: { required: true, type: "string" - } - }, - url: "/gists/:gist_id/star" - }, - create: { - method: "POST", - params: { - description: { - type: "string" }, - files: { + repo: { required: true, - type: "object" - }, - "files.content": { type: "string" }, - public: { - type: "boolean" - } - }, - url: "/gists" - }, - createComment: { - method: "POST", - params: { - body: { - required: true, + since: { type: "string" }, - gist_id: { - required: true, - type: "string" - } - }, - url: "/gists/:gist_id/comments" - }, - delete: { - method: "DELETE", - params: { - gist_id: { - required: true, + sort: { + enum: ["created", "updated"], type: "string" } }, - url: "/gists/:gist_id" + url: "/repos/:owner/:repo/issues/comments" }, - deleteComment: { - method: "DELETE", + listEvents: { + method: "GET", params: { - comment_id: { + issue_number: { required: true, type: "integer" }, - gist_id: { + number: { + alias: "issue_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" - } - }, - url: "/gists/:gist_id/comments/:comment_id" - }, - fork: { - method: "POST", - params: { - gist_id: { + }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/gists/:gist_id/forks" + url: "/repos/:owner/:repo/issues/:issue_number/events" }, - get: { + listEventsForRepo: { method: "GET", params: { - gist_id: { + owner: { required: true, type: "string" - } - }, - url: "/gists/:gist_id" - }, - getComment: { - method: "GET", - params: { - comment_id: { - required: true, + }, + page: { type: "integer" }, - gist_id: { + per_page: { + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/gists/:gist_id/comments/:comment_id" + url: "/repos/:owner/:repo/issues/events" }, - getRevision: { + listEventsForTimeline: { + headers: { + accept: "application/vnd.github.mockingbird-preview+json" + }, method: "GET", params: { - gist_id: { + issue_number: { + required: true, + type: "integer" + }, + number: { + alias: "issue_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - sha: { + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/gists/:gist_id/:sha" + url: "/repos/:owner/:repo/issues/:issue_number/timeline" }, - list: { + 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" }, @@ -8362,14 +5463,33 @@ var endpointsByScope = { }, since: { type: "string" + }, + sort: { + enum: ["created", "updated", "comments"], + type: "string" + }, + state: { + enum: ["open", "closed", "all"], + type: "string" } }, - url: "/gists" + url: "/user/issues" }, - listComments: { + listForOrg: { method: "GET", params: { - gist_id: { + direction: { + enum: ["asc", "desc"], + type: "string" + }, + filter: { + enum: ["assigned", "created", "mentioned", "subscribed", "all"], + type: "string" + }, + labels: { + type: "string" + }, + org: { required: true, type: "string" }, @@ -8378,14 +5498,44 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + since: { + type: "string" + }, + sort: { + enum: ["created", "updated", "comments"], + type: "string" + }, + state: { + enum: ["open", "closed", "all"], + type: "string" } }, - url: "/gists/:gist_id/comments" + url: "/orgs/:org/issues" }, - listCommits: { + listForRepo: { method: "GET", params: { - gist_id: { + 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" }, @@ -8394,14 +5544,38 @@ var endpointsByScope = { }, 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: "/gists/:gist_id/commits" + url: "/repos/:owner/:repo/issues" }, - listForks: { + listLabelsForMilestone: { method: "GET", params: { - gist_id: { + milestone_number: { + required: true, + type: "integer" + }, + number: { + alias: "milestone_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, @@ -8410,130 +5584,212 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + repo: { + required: true, + type: "string" } }, - url: "/gists/:gist_id/forks" + url: "/repos/:owner/:repo/milestones/:milestone_number/labels" }, - listPublic: { + listLabelsForRepo: { method: "GET", params: { + owner: { + required: true, + type: "string" + }, page: { type: "integer" }, per_page: { type: "integer" }, - since: { + repo: { + required: true, type: "string" } }, - url: "/gists/public" + url: "/repos/:owner/:repo/labels" }, - listPublicForUser: { + listLabelsOnIssue: { method: "GET", params: { - page: { + issue_number: { + required: true, type: "integer" }, - per_page: { + number: { + alias: "issue_number", + deprecated: true, type: "integer" }, - since: { + owner: { + required: true, type: "string" }, - username: { + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/users/:username/gists" + url: "/repos/:owner/:repo/issues/:issue_number/labels" }, - listStarred: { + listMilestonesForRepo: { method: "GET", params: { + direction: { + enum: ["asc", "desc"], + type: "string" + }, + owner: { + required: true, + type: "string" + }, page: { type: "integer" }, per_page: { type: "integer" }, - since: { + repo: { + required: true, + type: "string" + }, + sort: { + enum: ["due_on", "completeness"], + type: "string" + }, + state: { + enum: ["open", "closed", "all"], type: "string" } }, - url: "/gists/starred" + url: "/repos/:owner/:repo/milestones" }, - star: { + lock: { method: "PUT", params: { - gist_id: { + 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: "/gists/:gist_id/star" + url: "/repos/:owner/:repo/issues/:issue_number/lock" }, - unstar: { + removeAssignees: { method: "DELETE", params: { - gist_id: { + 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: "/gists/:gist_id/star" + url: "/repos/:owner/:repo/issues/:issue_number/assignees" }, - update: { - method: "PATCH", + removeLabel: { + method: "DELETE", params: { - description: { - type: "string" - }, - files: { - type: "object" + issue_number: { + required: true, + type: "integer" }, - "files.content": { + name: { + required: true, type: "string" }, - "files.filename": { + number: { + alias: "issue_number", + deprecated: true, + type: "integer" + }, + owner: { + required: true, type: "string" }, - gist_id: { + repo: { required: true, type: "string" } }, - url: "/gists/:gist_id" + url: "/repos/:owner/:repo/issues/:issue_number/labels/:name" }, - updateComment: { - method: "PATCH", + removeLabels: { + method: "DELETE", params: { - body: { + issue_number: { required: true, - type: "string" + type: "integer" }, - comment_id: { - required: true, + number: { + alias: "issue_number", + deprecated: true, type: "integer" }, - gist_id: { + owner: { + required: true, + type: "string" + }, + repo: { required: true, type: "string" } }, - url: "/gists/:gist_id/comments/:comment_id" - } - }, - git: { - createBlob: { - method: "POST", + url: "/repos/:owner/:repo/issues/:issue_number/labels" + }, + replaceLabels: { + method: "PUT", params: { - content: { + issue_number: { required: true, - type: "string" + type: "integer" }, - encoding: { - type: "string" + labels: { + type: "string[]" + }, + number: { + alias: "issue_number", + deprecated: true, + type: "integer" }, owner: { required: true, @@ -8544,94 +5800,115 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/git/blobs" + url: "/repos/:owner/:repo/issues/:issue_number/labels" }, - createCommit: { - method: "POST", + unlock: { + method: "DELETE", params: { - author: { - type: "object" + issue_number: { + required: true, + type: "integer" }, - "author.date": { - type: "string" + number: { + alias: "issue_number", + deprecated: true, + type: "integer" }, - "author.email": { + owner: { + required: true, type: "string" }, - "author.name": { + repo: { + required: true, type: "string" - }, - committer: { - type: "object" - }, - "committer.date": { + } + }, + url: "/repos/:owner/:repo/issues/:issue_number/lock" + }, + update: { + method: "PATCH", + params: { + assignee: { type: "string" }, - "committer.email": { - type: "string" + assignees: { + type: "string[]" }, - "committer.name": { + body: { type: "string" }, - message: { + issue_number: { required: true, - type: "string" + type: "integer" + }, + labels: { + type: "string[]" + }, + milestone: { + allowNull: true, + type: "integer" + }, + number: { + alias: "issue_number", + deprecated: true, + type: "integer" }, owner: { required: true, type: "string" }, - parents: { - required: true, - type: "string[]" - }, repo: { required: true, type: "string" }, - signature: { + state: { + enum: ["open", "closed"], type: "string" }, - tree: { - required: true, + title: { type: "string" } }, - url: "/repos/:owner/:repo/git/commits" + url: "/repos/:owner/:repo/issues/:issue_number" }, - createRef: { - method: "POST", + updateComment: { + method: "PATCH", params: { - owner: { + body: { required: true, type: "string" }, - ref: { + comment_id: { required: true, - type: "string" + type: "integer" }, - repo: { + owner: { required: true, type: "string" }, - sha: { + repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/git/refs" + url: "/repos/:owner/:repo/issues/comments/:comment_id" }, - createTag: { - method: "POST", + updateLabel: { + method: "PATCH", params: { - message: { - required: true, + color: { type: "string" }, - object: { + current_name: { required: true, type: "string" }, + description: { + type: "string" + }, + name: { + type: "string" + }, owner: { required: true, type: "string" @@ -8639,37 +5916,128 @@ var endpointsByScope = { repo: { required: true, type: "string" + } + }, + url: "/repos/:owner/:repo/labels/:current_name" + }, + updateMilestone: { + method: "PATCH", + params: { + description: { + type: "string" }, - tag: { + due_on: { + type: "string" + }, + milestone_number: { + required: true, + type: "integer" + }, + number: { + alias: "milestone_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - tagger: { - type: "object" + repo: { + required: true, + type: "string" }, - "tagger.date": { + state: { + enum: ["open", "closed"], type: "string" }, - "tagger.email": { + 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" }, - "tagger.name": { + mode: { + enum: ["markdown", "gfm"], type: "string" }, - type: { - enum: ["commit", "tree", "blob"], + text: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/git/tags" + url: "/markdown" }, - createTree: { + renderRaw: { + headers: { + "content-type": "text/plain; charset=utf-8" + }, method: "POST", params: { - base_tree: { + 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" @@ -8677,75 +6045,91 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - tree: { + } + }, + url: "/repos/:owner/:repo/import" + }, + deleteArchiveForAuthenticatedUser: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, + method: "DELETE", + params: { + migration_id: { 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" + type: "integer" } }, - url: "/repos/:owner/:repo/git/trees" + url: "/user/migrations/:migration_id/archive" }, - deleteRef: { + deleteArchiveForOrg: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, method: "DELETE", params: { - owner: { + migration_id: { required: true, - type: "string" + type: "integer" }, - ref: { + 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" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/git/refs/:ref" + url: "/orgs/:org/migrations/:migration_id/archive" }, - getBlob: { + getArchiveForAuthenticatedUser: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, method: "GET", params: { - file_sha: { + migration_id: { required: true, - type: "string" - }, - owner: { + 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: "string" + type: "integer" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/git/blobs/:file_sha" + url: "/orgs/:org/migrations/:migration_id/archive" }, - getCommit: { + getCommitAuthors: { method: "GET", params: { - commit_sha: { - required: true, - type: "string" - }, owner: { required: true, type: "string" @@ -8753,29 +6137,28 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + since: { + type: "string" } }, - url: "/repos/:owner/:repo/git/commits/:commit_sha" + url: "/repos/:owner/:repo/import/authors" }, - getRef: { + getImportProgress: { 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" + url: "/repos/:owner/:repo/import" }, - getTag: { + getLargeFiles: { method: "GET", params: { owner: { @@ -8785,40 +6168,62 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - tag_sha: { + } + }, + url: "/repos/:owner/:repo/import/large_files" + }, + getStatusForAuthenticatedUser: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, + method: "GET", + params: { + migration_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/git/tags/:tag_sha" + url: "/user/migrations/:migration_id" }, - getTree: { + getStatusForOrg: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, method: "GET", params: { - owner: { + migration_id: { required: true, - type: "string" - }, - recursive: { - enum: ["1"], type: "integer" }, - repo: { + 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" }, - tree_sha: { - required: true, - type: "string" + per_page: { + type: "integer" } }, - url: "/repos/:owner/:repo/git/trees/:tree_sha" + url: "/user/migrations" }, - listMatchingRefs: { + listForOrg: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, method: "GET", params: { - owner: { + org: { required: true, type: "string" }, @@ -8827,52 +6232,80 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - ref: { + } + }, + url: "/orgs/:org/migrations" + }, + listReposForOrg: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, + method: "GET", + params: { + migration_id: { required: true, - type: "string" + type: "integer" }, - repo: { + org: { required: true, type: "string" + }, + page: { + type: "integer" + }, + per_page: { + type: "integer" } }, - url: "/repos/:owner/:repo/git/matching-refs/:ref" + url: "/orgs/:org/migrations/:migration_id/repositories" }, - listRefs: { + listReposForUser: { + headers: { + accept: "application/vnd.github.wyandotte-preview+json" + }, method: "GET", params: { - namespace: { - type: "string" - }, - owner: { + migration_id: { required: true, - type: "string" + type: "integer" }, page: { type: "integer" }, per_page: { type: "integer" - }, - repo: { - required: true, - type: "string" } }, - url: "/repos/:owner/:repo/git/refs/:namespace" + url: "/user/:migration_id/repositories" }, - updateRef: { + mapCommitAuthor: { method: "PATCH", params: { - force: { - type: "boolean" + author_id: { + required: true, + type: "integer" + }, + email: { + type: "string" + }, + name: { + type: "string" }, owner: { required: true, type: "string" }, - ref: { + repo: { + required: true, + type: "string" + } + }, + url: "/repos/:owner/:repo/import/authors/:author_id" + }, + setLfsPreference: { + method: "PATCH", + params: { + owner: { required: true, type: "string" }, @@ -8880,61 +6313,53 @@ var endpointsByScope = { required: true, type: "string" }, - sha: { + use_lfs: { + enum: ["opt_in", "opt_out"], required: true, type: "string" } }, - url: "/repos/:owner/:repo/git/refs/:ref" - } - }, - gitignore: { - getTemplate: { - method: "GET", + url: "/repos/:owner/:repo/import/lfs" + }, + startForAuthenticatedUser: { + method: "POST", params: { - name: { + exclude_attachments: { + type: "boolean" + }, + lock_repositories: { + type: "boolean" + }, + repositories: { required: true, - type: "string" + type: "string[]" } }, - url: "/gitignore/templates/:name" + url: "/user/migrations" }, - listTemplates: { - method: "GET", - params: {}, - url: "/gitignore/templates" - } - }, - interactions: { - addOrUpdateRestrictionsForOrg: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "PUT", + startForOrg: { + method: "POST", params: { - limit: { - enum: ["existing_users", "contributors_only", "collaborators_only"], - required: true, - type: "string" + exclude_attachments: { + type: "boolean" + }, + lock_repositories: { + type: "boolean" }, org: { required: true, type: "string" + }, + repositories: { + required: true, + type: "string[]" } }, - url: "/orgs/:org/interaction-limits" + url: "/orgs/:org/migrations" }, - addOrUpdateRestrictionsForRepo: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, + startImport: { method: "PUT", params: { - limit: { - enum: ["existing_users", "contributors_only", "collaborators_only"], - required: true, - type: "string" - }, owner: { required: true, type: "string" @@ -8942,58 +6367,67 @@ var endpointsByScope = { repo: { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/interaction-limits" - }, - getRestrictionsForOrg: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "GET", - params: { - org: { + }, + 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: "/orgs/:org/interaction-limits" + url: "/repos/:owner/:repo/import" }, - getRestrictionsForRepo: { + unlockRepoForAuthenticatedUser: { headers: { - accept: "application/vnd.github.sombra-preview+json" + accept: "application/vnd.github.wyandotte-preview+json" }, - method: "GET", + method: "DELETE", params: { - owner: { + migration_id: { required: true, - type: "string" + type: "integer" }, - repo: { + repo_name: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/interaction-limits" + url: "/user/migrations/:migration_id/repos/:repo_name/lock" }, - removeRestrictionsForOrg: { + unlockRepoForOrg: { headers: { - accept: "application/vnd.github.sombra-preview+json" + 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/interaction-limits" + url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock" }, - removeRestrictionsForRepo: { - headers: { - accept: "application/vnd.github.sombra-preview+json" - }, - method: "DELETE", + updateImport: { + method: "PATCH", params: { owner: { required: true, @@ -9002,595 +6436,568 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + vcs_password: { + type: "string" + }, + vcs_username: { + type: "string" } }, - url: "/repos/:owner/:repo/interaction-limits" + url: "/repos/:owner/:repo/import" } }, - issues: { - addAssignees: { - method: "POST", + oauthAuthorizations: { + checkAuthorization: { + deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)", + method: "GET", params: { - assignees: { - type: "string[]" + access_token: { + required: true, + type: "string" }, - issue_number: { + client_id: { required: true, - type: "integer" + 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" }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" + client_secret: { + type: "string" }, - owner: { - required: true, + fingerprint: { type: "string" }, - repo: { + note: { required: true, type: "string" + }, + note_url: { + type: "string" + }, + scopes: { + type: "string[]" } }, - url: "/repos/:owner/:repo/issues/:issue_number/assignees" + url: "/authorizations" }, - addLabels: { - method: "POST", + deleteAuthorization: { + deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization", + method: "DELETE", params: { - issue_number: { + authorization_id: { required: true, type: "integer" - }, - labels: { + } + }, + 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: "string[]" - }, - number: { - alias: "issue_number", - deprecated: true, type: "integer" - }, - owner: { + } + }, + 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" }, - repo: { + client_secret: { required: true, type: "string" + }, + fingerprint: { + type: "string" + }, + note: { + type: "string" + }, + note_url: { + type: "string" + }, + scopes: { + type: "string[]" } }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" + url: "/authorizations/clients/:client_id" }, - checkAssignee: { - method: "GET", + 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: { - assignee: { + client_id: { required: true, type: "string" }, - owner: { + client_secret: { required: true, type: "string" }, - repo: { + fingerprint: { required: true, type: "string" + }, + note: { + type: "string" + }, + note_url: { + type: "string" + }, + scopes: { + type: "string[]" } }, - url: "/repos/:owner/:repo/assignees/:assignee" + url: "/authorizations/clients/:client_id/:fingerprint" }, - create: { - method: "POST", + getOrCreateAuthorizationForAppFingerprint: { + deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)", + method: "PUT", params: { - assignee: { + client_id: { + required: true, type: "string" }, - assignees: { - type: "string[]" - }, - body: { + client_secret: { + required: true, type: "string" }, - labels: { - type: "string[]" - }, - milestone: { - type: "integer" - }, - owner: { + fingerprint: { required: true, type: "string" }, - repo: { - required: true, + note: { type: "string" }, - title: { - required: true, + note_url: { type: "string" + }, + scopes: { + type: "string[]" } }, - url: "/repos/:owner/:repo/issues" + url: "/authorizations/clients/:client_id/:fingerprint" }, - createComment: { - method: "POST", + listAuthorizations: { + deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations", + method: "GET", params: { - body: { - required: true, - type: "string" - }, - issue_number: { - required: true, + page: { type: "integer" }, - number: { - alias: "issue_number", - deprecated: true, + 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" }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" } }, - url: "/repos/:owner/:repo/issues/:issue_number/comments" + url: "/applications/grants" }, - createLabel: { + resetAuthorization: { + deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)", method: "POST", params: { - color: { + access_token: { required: true, type: "string" }, - description: { - type: "string" - }, - name: { + client_id: { required: true, type: "string" - }, - owner: { + } + }, + 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" }, - repo: { + client_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/labels" + url: "/applications/:client_id/tokens/:access_token" }, - createMilestone: { - method: "POST", + revokeGrantForApplication: { + deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)", + method: "DELETE", params: { - description: { - type: "string" - }, - due_on: { - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { + access_token: { required: true, type: "string" }, - state: { - enum: ["open", "closed"], - type: "string" - }, - title: { + client_id: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/milestones" + url: "/applications/:client_id/grants/:access_token" }, - deleteComment: { - method: "DELETE", + updateAuthorization: { + deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization", + method: "PATCH", params: { - comment_id: { + add_scopes: { + type: "string[]" + }, + authorization_id: { required: true, type: "integer" }, - owner: { - required: true, + fingerprint: { type: "string" }, - repo: { - required: true, + note: { type: "string" + }, + note_url: { + type: "string" + }, + remove_scopes: { + type: "string[]" + }, + scopes: { + type: "string[]" } }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" - }, - deleteLabel: { - method: "DELETE", + url: "/authorizations/:authorization_id" + } + }, + orgs: { + addOrUpdateMembership: { + method: "PUT", params: { - name: { + org: { required: true, type: "string" }, - owner: { - required: true, + role: { + enum: ["admin", "member"], type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/labels/:name" + url: "/orgs/:org/memberships/:username" }, - deleteMilestone: { - method: "DELETE", + blockUser: { + method: "PUT", params: { - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/milestones/:milestone_number" + url: "/orgs/:org/blocks/:username" }, - get: { + checkBlockedUser: { method: "GET", params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number" + url: "/orgs/:org/blocks/:username" }, - getComment: { + checkMembership: { method: "GET", params: { - comment_id: { - required: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" + url: "/orgs/:org/members/:username" }, - getEvent: { + checkPublicMembership: { method: "GET", params: { - event_id: { - required: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/events/:event_id" + url: "/orgs/:org/public_members/:username" }, - getLabel: { - method: "GET", + concealMembership: { + method: "DELETE", params: { - name: { - required: true, - type: "string" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/labels/:name" + url: "/orgs/:org/public_members/:username" }, - getMilestone: { - method: "GET", + convertMemberToOutsideCollaborator: { + method: "PUT", params: { - milestone_number: { - required: true, - type: "integer" - }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/milestones/:milestone_number" + url: "/orgs/:org/outside_collaborators/:username" }, - list: { - method: "GET", + createHook: { + method: "POST", params: { - direction: { - enum: ["asc", "desc"], - type: "string" + active: { + type: "boolean" }, - filter: { - enum: ["assigned", "created", "mentioned", "subscribed", "all"], - type: "string" + config: { + required: true, + type: "object" }, - labels: { + "config.content_type": { type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - since: { + "config.insecure_ssl": { type: "string" }, - sort: { - enum: ["created", "updated", "comments"], + "config.secret": { type: "string" }, - state: { - enum: ["open", "closed", "all"], - type: "string" - } - }, - url: "/issues" - }, - listAssignees: { - method: "GET", - params: { - owner: { + "config.url": { required: true, type: "string" }, - page: { - type: "integer" + events: { + type: "string[]" }, - per_page: { - type: "integer" + name: { + required: true, + type: "string" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/assignees" + url: "/orgs/:org/hooks" }, - listComments: { - method: "GET", + createInvitation: { + method: "POST", params: { - issue_number: { - required: true, - type: "integer" + email: { + type: "string" }, - number: { - alias: "issue_number", - deprecated: true, + invitee_id: { type: "integer" }, - owner: { + org: { required: true, type: "string" }, - page: { - type: "integer" + role: { + enum: ["admin", "direct_member", "billing_manager"], + type: "string" }, - per_page: { + team_ids: { + type: "integer[]" + } + }, + url: "/orgs/:org/invitations" + }, + deleteHook: { + method: "DELETE", + params: { + hook_id: { + required: true, type: "integer" }, - repo: { + org: { required: true, type: "string" - }, - since: { - type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/comments" + url: "/orgs/:org/hooks/:hook_id" }, - listCommentsForRepo: { + get: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { + org: { required: true, type: "string" - }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated"], - type: "string" } }, - url: "/repos/:owner/:repo/issues/comments" + url: "/orgs/:org" }, - listEvents: { + getHook: { method: "GET", params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + hook_id: { required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { type: "integer" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/events" + url: "/orgs/:org/hooks/:hook_id" }, - listEventsForRepo: { + getMembership: { method: "GET", params: { - owner: { + org: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/events" + url: "/orgs/:org/memberships/:username" }, - listEventsForTimeline: { - headers: { - accept: "application/vnd.github.mockingbird-preview+json" - }, + getMembershipForAuthenticatedUser: { method: "GET", params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" - }, + } + }, + url: "/user/memberships/orgs/:org" + }, + list: { + method: "GET", + params: { page: { type: "integer" }, per_page: { type: "integer" }, - repo: { + since: { + type: "integer" + } + }, + url: "/organizations" + }, + listBlockedUsers: { + method: "GET", + params: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/timeline" + url: "/orgs/:org/blocks" }, 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" + } + }, + url: "/user/orgs" + }, + listForUser: { + method: "GET", + params: { + page: { + type: "integer" }, - since: { - type: "string" - }, - sort: { - enum: ["created", "updated", "comments"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], + per_page: { + type: "integer" + }, + username: { + required: true, type: "string" } }, - url: "/user/issues" + url: "/users/:username/orgs" }, - listForOrg: { + listHooks: { 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" @@ -9600,44 +7007,17 @@ var endpointsByScope = { }, 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" + url: "/orgs/:org/hooks" }, - listForRepo: { + listInstallations: { + headers: { + accept: "application/vnd.github.machine-man-preview+json" + }, 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: { + org: { required: true, type: "string" }, @@ -9646,38 +7026,18 @@ var endpointsByScope = { }, 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" + url: "/orgs/:org/installations" }, - listLabelsForMilestone: { + listInvitationTeams: { method: "GET", params: { - milestone_number: { + invitation_id: { required: true, type: "integer" }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, @@ -9686,18 +7046,18 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - repo: { - required: true, - type: "string" } }, - url: "/repos/:owner/:repo/milestones/:milestone_number/labels" + url: "/orgs/:org/invitations/:invitation_id/teams" }, - listLabelsForRepo: { + listMembers: { method: "GET", params: { - owner: { + filter: { + enum: ["2fa_disabled", "all"], + type: "string" + }, + org: { required: true, type: "string" }, @@ -9707,50 +7067,37 @@ var endpointsByScope = { per_page: { type: "integer" }, - repo: { - required: true, + role: { + enum: ["all", "admin", "member"], type: "string" } }, - url: "/repos/:owner/:repo/labels" + url: "/orgs/:org/members" }, - listLabelsOnIssue: { + listMemberships: { 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, + state: { + enum: ["active", "pending"], type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" + url: "/user/memberships/orgs" }, - listMilestonesForRepo: { + listOutsideCollaborators: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], + filter: { + enum: ["2fa_disabled", "all"], type: "string" }, - owner: { + org: { required: true, type: "string" }, @@ -9759,387 +7106,342 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - repo: { + } + }, + url: "/orgs/:org/outside_collaborators" + }, + listPendingInvitations: { + method: "GET", + params: { + org: { required: true, type: "string" }, - sort: { - enum: ["due_on", "completeness"], - type: "string" + page: { + type: "integer" }, - state: { - enum: ["open", "closed", "all"], - type: "string" + per_page: { + type: "integer" } }, - url: "/repos/:owner/:repo/milestones" + url: "/orgs/:org/invitations" }, - lock: { - method: "PUT", + listPublicMembers: { + method: "GET", params: { - issue_number: { + org: { required: true, - type: "integer" - }, - lock_reason: { - enum: ["off-topic", "too heated", "resolved", "spam"], type: "string" }, - number: { - alias: "issue_number", - deprecated: true, + page: { type: "integer" }, - owner: { + per_page: { + type: "integer" + } + }, + url: "/orgs/:org/public_members" + }, + pingHook: { + method: "POST", + params: { + hook_id: { required: true, - type: "string" + type: "integer" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/lock" + url: "/orgs/:org/hooks/:hook_id/pings" }, - removeAssignees: { - method: "DELETE", + publicizeMembership: { + method: "PUT", params: { - assignees: { - type: "string[]" - }, - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/assignees" + url: "/orgs/:org/public_members/:username" }, - removeLabel: { + removeMember: { method: "DELETE", params: { - issue_number: { - required: true, - type: "integer" - }, - name: { - required: true, - type: "string" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/labels/:name" + url: "/orgs/:org/members/:username" }, - removeLabels: { + removeMembership: { method: "DELETE", params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" + url: "/orgs/:org/memberships/:username" }, - replaceLabels: { - method: "PUT", + removeOutsideCollaborator: { + method: "DELETE", params: { - issue_number: { - required: true, - type: "integer" - }, - labels: { - type: "string[]" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/labels" + url: "/orgs/:org/outside_collaborators/:username" }, - unlock: { + unblockUser: { method: "DELETE", params: { - issue_number: { - required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" - }, - owner: { + org: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/lock" + url: "/orgs/:org/blocks/:username" }, update: { method: "PATCH", params: { - assignee: { + billing_email: { type: "string" }, - assignees: { - type: "string[]" + company: { + type: "string" }, - body: { + default_repository_permission: { + enum: ["read", "write", "admin", "none"], type: "string" }, - issue_number: { - required: true, - type: "integer" + description: { + type: "string" }, - labels: { - type: "string[]" + email: { + type: "string" }, - milestone: { - allowNull: true, - type: "integer" + has_organization_projects: { + type: "boolean" }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" + has_repository_projects: { + type: "boolean" }, - owner: { - required: true, + location: { type: "string" }, - repo: { - required: true, + members_allowed_repository_creation_type: { + enum: ["all", "private", "none"], type: "string" }, - state: { - enum: ["open", "closed"], - type: "string" + members_can_create_internal_repositories: { + type: "boolean" }, - title: { - type: "string" - } - }, - url: "/repos/:owner/:repo/issues/:issue_number" - }, - updateComment: { - method: "PATCH", - params: { - body: { - required: true, - type: "string" + members_can_create_private_repositories: { + type: "boolean" }, - comment_id: { - required: true, - type: "integer" + members_can_create_public_repositories: { + type: "boolean" }, - owner: { - required: true, + members_can_create_repositories: { + type: "boolean" + }, + name: { type: "string" }, - repo: { + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/issues/comments/:comment_id" + url: "/orgs/:org" }, - updateLabel: { + updateHook: { method: "PATCH", params: { - color: { - type: "string" + active: { + type: "boolean" }, - current_name: { - required: true, + config: { + type: "object" + }, + "config.content_type": { type: "string" }, - description: { + "config.insecure_ssl": { type: "string" }, - name: { + "config.secret": { type: "string" }, - owner: { + "config.url": { required: true, type: "string" }, - repo: { + events: { + type: "string[]" + }, + hook_id: { + required: true, + type: "integer" + }, + org: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/labels/:current_name" + url: "/orgs/:org/hooks/:hook_id" }, - updateMilestone: { + updateMembership: { method: "PATCH", params: { - description: { + org: { + required: true, type: "string" }, - due_on: { + 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" }, - milestone_number: { + project_id: { required: true, type: "integer" }, - number: { - alias: "milestone_number", - deprecated: true, - type: "integer" - }, - owner: { + username: { required: true, type: "string" - }, - repo: { + } + }, + url: "/projects/:project_id/collaborators/:username" + }, + createCard: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "POST", + params: { + column_id: { required: true, - type: "string" + type: "integer" }, - state: { - enum: ["open", "closed"], + content_id: { + type: "integer" + }, + content_type: { type: "string" }, - title: { + note: { type: "string" } }, - url: "/repos/:owner/:repo/milestones/:milestone_number" - } - }, - licenses: { - get: { - method: "GET", + url: "/projects/columns/:column_id/cards" + }, + createColumn: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "POST", params: { - license: { + name: { required: true, type: "string" + }, + project_id: { + required: true, + type: "integer" } }, - url: "/licenses/:license" + url: "/projects/:project_id/columns" }, - getForRepo: { - method: "GET", + createForAuthenticatedUser: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "POST", params: { - owner: { - required: true, + body: { type: "string" }, - repo: { + name: { 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" + url: "/user/projects" }, - listCommonlyUsed: { - method: "GET", - params: {}, - url: "/licenses" - } - }, - markdown: { - render: { + createForOrg: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, method: "POST", params: { - context: { + body: { type: "string" }, - mode: { - enum: ["markdown", "gfm"], + name: { + required: true, type: "string" }, - text: { + org: { required: true, type: "string" } }, - url: "/markdown" + url: "/orgs/:org/projects" }, - renderRaw: { + createForRepo: { headers: { - "content-type": "text/plain; charset=utf-8" + accept: "application/vnd.github.inertia-preview+json" }, method: "POST", params: { - data: { - mapTo: "data", + body: { + type: "string" + }, + name: { required: true, type: "string" - } - }, - url: "/markdown/raw" - } - }, - meta: { - get: { - method: "GET", - params: {}, - url: "/meta" - } - }, - migrations: { - cancelImport: { - method: "DELETE", - params: { + }, owner: { required: true, type: "string" @@ -10149,164 +7451,135 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/import" + url: "/repos/:owner/:repo/projects" }, - deleteArchiveForAuthenticatedUser: { + delete: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "DELETE", params: { - migration_id: { + project_id: { required: true, type: "integer" } }, - url: "/user/migrations/:migration_id/archive" + url: "/projects/:project_id" }, - deleteArchiveForOrg: { + deleteCard: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "DELETE", params: { - migration_id: { + card_id: { required: true, type: "integer" - }, - org: { - required: true, - type: "string" } }, - url: "/orgs/:org/migrations/:migration_id/archive" + url: "/projects/columns/cards/:card_id" }, - downloadArchiveForOrg: { + deleteColumn: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, - method: "GET", + method: "DELETE", params: { - migration_id: { + column_id: { required: true, type: "integer" - }, - org: { - required: true, - type: "string" } }, - url: "/orgs/:org/migrations/:migration_id/archive" + url: "/projects/columns/:column_id" }, - getArchiveForAuthenticatedUser: { + get: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { - migration_id: { + project_id: { required: true, type: "integer" } }, - url: "/user/migrations/:migration_id/archive" + url: "/projects/:project_id" }, - getArchiveForOrg: { - deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)", + getCard: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { - migration_id: { + card_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" + url: "/projects/columns/cards/:card_id" }, - getImportProgress: { - method: "GET", - params: { - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } + getColumn: { + headers: { + accept: "application/vnd.github.inertia-preview+json" }, - url: "/repos/:owner/:repo/import" - }, - getLargeFiles: { method: "GET", params: { - owner: { - required: true, - type: "string" - }, - repo: { + column_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/import/large_files" + url: "/projects/columns/:column_id" }, - getStatusForAuthenticatedUser: { + listCards: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { - migration_id: { + archived_state: { + enum: ["all", "archived", "not_archived"], + type: "string" + }, + column_id: { required: true, type: "integer" + }, + page: { + type: "integer" + }, + per_page: { + type: "integer" } }, - url: "/user/migrations/:migration_id" + url: "/projects/columns/:column_id/cards" }, - getStatusForOrg: { + listCollaborators: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { - migration_id: { - required: true, + affiliation: { + enum: ["outside", "direct", "all"], + type: "string" + }, + page: { type: "integer" }, - org: { + per_page: { + type: "integer" + }, + project_id: { required: true, - type: "string" + type: "integer" } }, - url: "/orgs/:org/migrations/:migration_id" + url: "/projects/:project_id/collaborators" }, - listForAuthenticatedUser: { + listColumns: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { @@ -10315,13 +7588,17 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + project_id: { + required: true, + type: "integer" } }, - url: "/user/migrations" + url: "/projects/:project_id/columns" }, listForOrg: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { @@ -10334,21 +7611,21 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + state: { + enum: ["open", "closed", "all"], + type: "string" } }, - url: "/orgs/:org/migrations" + url: "/orgs/:org/projects" }, - listReposForOrg: { + listForRepo: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, method: "GET", params: { - migration_id: { - required: true, - type: "integer" - }, - org: { + owner: { required: true, type: "string" }, @@ -10357,750 +7634,710 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + repo: { + required: true, + type: "string" + }, + state: { + enum: ["open", "closed", "all"], + type: "string" } }, - url: "/orgs/:org/migrations/:migration_id/repositories" + url: "/repos/:owner/:repo/projects" }, - listReposForUser: { + listForUser: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-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, + state: { + enum: ["open", "closed", "all"], type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/import/authors/:author_id" + url: "/users/:username/projects" }, - setLfsPreference: { - method: "PATCH", + moveCard: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "POST", params: { - owner: { + card_id: { required: true, - type: "string" + type: "integer" }, - repo: { - required: true, - type: "string" + column_id: { + type: "integer" }, - use_lfs: { - enum: ["opt_in", "opt_out"], + position: { required: true, - type: "string" + type: "string", + validation: "^(top|bottom|after:\\d+)$" } }, - url: "/repos/:owner/:repo/import/lfs" + url: "/projects/columns/cards/:card_id/moves" }, - startForAuthenticatedUser: { + moveColumn: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, method: "POST", params: { - exclude_attachments: { - type: "boolean" - }, - lock_repositories: { - type: "boolean" + column_id: { + required: true, + type: "integer" }, - repositories: { + position: { required: true, - type: "string[]" + type: "string", + validation: "^(first|last|after:\\d+)$" } }, - url: "/user/migrations" + url: "/projects/columns/:column_id/moves" }, - startForOrg: { - method: "POST", + removeCollaborator: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "DELETE", params: { - exclude_attachments: { - type: "boolean" - }, - lock_repositories: { - type: "boolean" - }, - org: { + project_id: { required: true, - type: "string" + type: "integer" }, - repositories: { + username: { required: true, - type: "string[]" + type: "string" } }, - url: "/orgs/:org/migrations" + url: "/projects/:project_id/collaborators/:username" }, - startImport: { - method: "PUT", + reviewUserPermissionLevel: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "GET", params: { - owner: { + project_id: { required: true, - type: "string" + type: "integer" }, - repo: { + username: { required: true, type: "string" - }, - tfvc_project: { + } + }, + url: "/projects/:project_id/collaborators/:username/permission" + }, + update: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "PATCH", + params: { + body: { type: "string" }, - vcs: { - enum: ["subversion", "git", "mercurial", "tfvc"], + name: { type: "string" }, - vcs_password: { + organization_permission: { type: "string" }, - vcs_url: { - required: true, - type: "string" + private: { + type: "boolean" }, - vcs_username: { - type: "string" - } - }, - url: "/repos/:owner/:repo/import" - }, - unlockRepoForAuthenticatedUser: { - headers: { - accept: "application/vnd.github.wyandotte-preview+json" - }, - method: "DELETE", - params: { - migration_id: { + project_id: { required: true, type: "integer" }, - repo_name: { - required: true, + state: { + enum: ["open", "closed"], type: "string" } }, - url: "/user/migrations/:migration_id/repos/:repo_name/lock" + url: "/projects/:project_id" }, - unlockRepoForOrg: { + updateCard: { headers: { - accept: "application/vnd.github.wyandotte-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, - method: "DELETE", + method: "PATCH", params: { - migration_id: { - required: true, - type: "integer" + archived: { + type: "boolean" }, - org: { + card_id: { required: true, - type: "string" + type: "integer" }, - repo_name: { - required: true, + note: { type: "string" } }, - url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock" + url: "/projects/columns/cards/:card_id" }, - updateImport: { + updateColumn: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, method: "PATCH", params: { - owner: { + column_id: { required: true, - type: "string" + type: "integer" }, - repo: { + name: { required: true, type: "string" - }, - vcs_password: { - type: "string" - }, - vcs_username: { - type: "string" } }, - url: "/repos/:owner/:repo/import" + url: "/projects/columns/:column_id" } }, - oauthAuthorizations: { - checkAuthorization: { - deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)", + pulls: { + checkIfMerged: { method: "GET", params: { - access_token: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - client_id: { + pull_number: { + required: true, + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/applications/:client_id/tokens/:access_token" + url: "/repos/:owner/:repo/pulls/:pull_number/merge" }, - createAuthorization: { - deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization", + create: { method: "POST", params: { - client_id: { + base: { + required: true, type: "string" }, - client_secret: { + body: { type: "string" }, - fingerprint: { + draft: { + type: "boolean" + }, + head: { + required: true, type: "string" }, - note: { + maintainer_can_modify: { + type: "boolean" + }, + owner: { required: true, type: "string" }, - note_url: { + repo: { + required: true, 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: { + title: { required: true, - type: "integer" + type: "string" } }, - url: "/authorizations/:authorization_id" + url: "/repos/:owner/:repo/pulls" }, - deleteGrant: { - deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant", - method: "DELETE", + createComment: { + method: "POST", params: { - grant_id: { + body: { 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: { + 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" - } - }, - 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, + }, + line: { 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: { + }, + 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: "string" + type: "integer" }, - client_secret: { + repo: { required: true, type: "string" }, - fingerprint: { + side: { + enum: ["LEFT", "RIGHT"], type: "string" }, - note: { - type: "string" + start_line: { + type: "integer" }, - note_url: { + start_side: { + enum: ["LEFT", "RIGHT", "side"], type: "string" - }, - scopes: { - type: "string[]" } }, - url: "/authorizations/clients/:client_id" + url: "/repos/:owner/:repo/pulls/:pull_number/comments" }, - 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", + createCommentReply: { + deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)", + method: "POST", params: { - client_id: { + body: { required: true, type: "string" }, - client_secret: { + commit_id: { required: true, type: "string" }, - fingerprint: { - 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" }, - note: { - type: "string" + line: { + type: "integer" }, - note_url: { - type: "string" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - 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: { + owner: { required: true, type: "string" }, - client_secret: { + path: { required: true, type: "string" }, - fingerprint: { + position: { + type: "integer" + }, + pull_number: { required: true, - type: "string" + type: "integer" }, - note: { + repo: { + required: true, type: "string" }, - note_url: { + side: { + enum: ["LEFT", "RIGHT"], 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: { + start_line: { type: "integer" }, - per_page: { - type: "integer" + start_side: { + enum: ["LEFT", "RIGHT", "side"], + type: "string" } }, - url: "/applications/grants" + url: "/repos/:owner/:repo/pulls/:pull_number/comments" }, - resetAuthorization: { - deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)", + createFromIssue: { + deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request", method: "POST", params: { - access_token: { + base: { required: true, type: "string" }, - client_id: { + draft: { + type: "boolean" + }, + head: { 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: { + }, + issue: { + required: true, + type: "integer" + }, + maintainer_can_modify: { + type: "boolean" + }, + owner: { required: true, type: "string" }, - client_id: { + repo: { required: true, type: "string" } }, - url: "/applications/:client_id/tokens/:access_token" + url: "/repos/:owner/:repo/pulls" }, - revokeGrantForApplication: { - deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)", - method: "DELETE", + createReview: { + method: "POST", params: { - access_token: { + body: { + type: "string" + }, + comments: { + type: "object[]" + }, + "comments[].body": { required: true, type: "string" }, - client_id: { + "comments[].path": { 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: { + "comments[].position": { required: true, type: "integer" }, - fingerprint: { - type: "string" - }, - note: { + commit_id: { type: "string" }, - note_url: { + event: { + enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], type: "string" }, - remove_scopes: { - type: "string[]" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - scopes: { - type: "string[]" - } - }, - url: "/authorizations/:authorization_id" - } - }, - orgs: { - addOrUpdateMembership: { - method: "PUT", - params: { - org: { + owner: { required: true, type: "string" }, - role: { - enum: ["admin", "member"], - type: "string" + pull_number: { + required: true, + type: "integer" }, - username: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/memberships/:username" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews" }, - blockUser: { - method: "PUT", + createReviewCommentReply: { + method: "POST", params: { - org: { + body: { required: true, type: "string" }, - username: { + comment_id: { required: true, - type: "string" - } - }, - url: "/orgs/:org/blocks/:username" - }, - checkBlockedUser: { - method: "GET", - params: { - org: { + type: "integer" + }, + owner: { required: true, type: "string" }, - username: { + pull_number: { + required: true, + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/orgs/:org/blocks/:username" + url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies" }, - checkMembership: { - method: "GET", + createReviewRequest: { + method: "POST", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - username: { + pull_number: { + required: true, + type: "integer" + }, + repo: { required: true, type: "string" + }, + reviewers: { + type: "string[]" + }, + team_reviewers: { + type: "string[]" } }, - url: "/orgs/:org/members/:username" + url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" }, - checkPublicMembership: { - method: "GET", + deleteComment: { + method: "DELETE", params: { - org: { + comment_id: { + required: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - username: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/public_members/:username" + url: "/repos/:owner/:repo/pulls/comments/:comment_id" }, - concealMembership: { + deletePendingReview: { method: "DELETE", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - username: { + pull_number: { required: true, - type: "string" - } - }, - url: "/orgs/:org/public_members/:username" - }, - convertMemberToOutsideCollaborator: { - method: "PUT", - params: { - org: { + type: "integer" + }, + repo: { required: true, type: "string" }, - username: { + review_id: { required: true, - type: "string" + type: "integer" } }, - url: "/orgs/:org/outside_collaborators/:username" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" }, - createHook: { - method: "POST", + deleteReviewRequest: { + method: "DELETE", params: { - active: { - type: "boolean" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - config: { + owner: { required: true, - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { type: "string" }, - "config.secret": { - type: "string" + pull_number: { + required: true, + type: "integer" }, - "config.url": { + repo: { required: true, type: "string" }, - events: { + reviewers: { type: "string[]" }, - name: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" + team_reviewers: { + type: "string[]" } }, - url: "/orgs/:org/hooks" + url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" }, - createInvitation: { - method: "POST", + dismissReview: { + method: "PUT", params: { - email: { + message: { + required: true, type: "string" }, - invitee_id: { + number: { + alias: "pull_number", + deprecated: true, type: "integer" }, - org: { + owner: { 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: { + pull_number: { required: true, type: "integer" }, - org: { + repo: { required: true, type: "string" + }, + review_id: { + required: true, + type: "integer" } }, - url: "/orgs/:org/hooks/:hook_id" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals" }, get: { method: "GET", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" - } - }, - url: "/orgs/:org" - }, - getHook: { - method: "GET", - params: { - hook_id: { + }, + pull_number: { required: true, type: "integer" }, - org: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/hooks/:hook_id" + url: "/repos/:owner/:repo/pulls/:pull_number" }, - getMembership: { + getComment: { method: "GET", params: { - org: { + comment_id: { + required: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - username: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/memberships/:username" + url: "/repos/:owner/:repo/pulls/comments/:comment_id" }, - getMembershipForAuthenticatedUser: { + getCommentsForReview: { method: "GET", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" - } - }, - url: "/user/memberships/orgs/:org" - }, - list: { - method: "GET", - params: { + }, page: { type: "integer" }, per_page: { type: "integer" }, - since: { + pull_number: { + required: true, type: "integer" - } - }, - url: "/organizations" - }, - listBlockedUsers: { - method: "GET", - params: { - org: { + }, + repo: { required: true, type: "string" - } - }, - url: "/orgs/:org/blocks" - }, - listForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" }, - per_page: { + review_id: { + required: true, type: "integer" } }, - url: "/user/orgs" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments" }, - listForUser: { + getReview: { method: "GET", params: { - page: { + number: { + alias: "pull_number", + deprecated: true, type: "integer" }, - per_page: { + owner: { + required: true, + type: "string" + }, + pull_number: { + required: true, type: "integer" }, - username: { + repo: { required: true, type: "string" + }, + review_id: { + required: true, + type: "integer" } }, - url: "/users/:username/orgs" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" }, - listHooks: { + list: { method: "GET", params: { - org: { + base: { + type: "string" + }, + direction: { + enum: ["asc", "desc"], + type: "string" + }, + head: { + type: "string" + }, + owner: { required: true, type: "string" }, @@ -11109,17 +8346,35 @@ var endpointsByScope = { }, 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: "/orgs/:org/hooks" + url: "/repos/:owner/:repo/pulls" }, - listInstallations: { - headers: { - accept: "application/vnd.github.machine-man-preview+json" - }, + listComments: { method: "GET", params: { - org: { + direction: { + enum: ["asc", "desc"], + type: "string" + }, + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, @@ -11128,38 +8383,33 @@ var endpointsByScope = { }, per_page: { type: "integer" - } - }, - url: "/orgs/:org/installations" - }, - listInvitationTeams: { - method: "GET", - params: { - invitation_id: { + }, + pull_number: { required: true, type: "integer" }, - org: { + repo: { required: true, type: "string" }, - page: { - type: "integer" + since: { + type: "string" }, - per_page: { - type: "integer" + sort: { + enum: ["created", "updated"], + type: "string" } }, - url: "/orgs/:org/invitations/:invitation_id/teams" + url: "/repos/:owner/:repo/pulls/:pull_number/comments" }, - listMembers: { + listCommentsForRepo: { method: "GET", params: { - filter: { - enum: ["2fa_disabled", "all"], + direction: { + enum: ["asc", "desc"], type: "string" }, - org: { + owner: { required: true, type: "string" }, @@ -11169,37 +8419,29 @@ var endpointsByScope = { per_page: { type: "integer" }, - role: { - enum: ["all", "admin", "member"], + repo: { + required: true, type: "string" - } - }, - url: "/orgs/:org/members" - }, - listMemberships: { - method: "GET", - params: { - page: { - type: "integer" }, - per_page: { - type: "integer" + since: { + type: "string" }, - state: { - enum: ["active", "pending"], + sort: { + enum: ["created", "updated"], type: "string" } }, - url: "/user/memberships/orgs" + url: "/repos/:owner/:repo/pulls/comments" }, - listOutsideCollaborators: { + listCommits: { method: "GET", params: { - filter: { - enum: ["2fa_disabled", "all"], - type: "string" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - org: { + owner: { required: true, type: "string" }, @@ -11208,14 +8450,27 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + pull_number: { + required: true, + type: "integer" + }, + repo: { + required: true, + type: "string" } }, - url: "/orgs/:org/outside_collaborators" + url: "/repos/:owner/:repo/pulls/:pull_number/commits" }, - listPendingInvitations: { + listFiles: { method: "GET", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, @@ -11224,14 +8479,27 @@ var endpointsByScope = { }, per_page: { type: "integer" + }, + pull_number: { + required: true, + type: "integer" + }, + repo: { + required: true, + type: "string" } }, - url: "/orgs/:org/invitations" + url: "/repos/:owner/:repo/pulls/:pull_number/files" }, - listPublicMembers: { + listReviewRequests: { method: "GET", params: { - org: { + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, + owner: { required: true, type: "string" }, @@ -11240,691 +8508,610 @@ var endpointsByScope = { }, per_page: { type: "integer" - } - }, - url: "/orgs/:org/public_members" - }, - pingHook: { - method: "POST", - params: { - hook_id: { + }, + pull_number: { required: true, type: "integer" }, - org: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/hooks/:hook_id/pings" + url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" }, - publicizeMembership: { - method: "PUT", + listReviews: { + method: "GET", params: { - org: { - required: true, - type: "string" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/public_members/:username" - }, - removeMember: { - method: "DELETE", - params: { - org: { + owner: { required: true, type: "string" }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/members/:username" - }, - removeMembership: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" + page: { + type: "integer" }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/memberships/:username" - }, - removeOutsideCollaborator: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" + per_page: { + type: "integer" }, - username: { - required: true, - type: "string" - } - }, - url: "/orgs/:org/outside_collaborators/:username" - }, - unblockUser: { - method: "DELETE", - params: { - org: { + pull_number: { required: true, - type: "string" + type: "integer" }, - username: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/blocks/:username" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews" }, - update: { - method: "PATCH", + merge: { + method: "PUT", params: { - billing_email: { - type: "string" - }, - company: { - type: "string" - }, - default_repository_permission: { - enum: ["read", "write", "admin", "none"], + commit_message: { type: "string" }, - description: { + commit_title: { type: "string" }, - email: { + merge_method: { + enum: ["merge", "squash", "rebase"], type: "string" }, - has_organization_projects: { - type: "boolean" - }, - has_repository_projects: { - type: "boolean" - }, - location: { - type: "string" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - members_allowed_repository_creation_type: { - enum: ["all", "private", "none"], + owner: { + required: true, 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" + pull_number: { + required: true, + type: "integer" }, - name: { + repo: { + required: true, type: "string" }, - org: { - required: true, + sha: { type: "string" } }, - url: "/orgs/:org" + url: "/repos/:owner/:repo/pulls/:pull_number/merge" }, - updateHook: { - method: "PATCH", + submitReview: { + method: "POST", params: { - active: { - type: "boolean" - }, - config: { - type: "object" - }, - "config.content_type": { + body: { type: "string" }, - "config.insecure_ssl": { + event: { + enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], + required: true, type: "string" }, - "config.secret": { - type: "string" + number: { + alias: "pull_number", + deprecated: true, + type: "integer" }, - "config.url": { + owner: { required: true, type: "string" }, - events: { - type: "string[]" - }, - hook_id: { + pull_number: { required: true, type: "integer" }, - org: { + repo: { required: true, type: "string" + }, + review_id: { + required: true, + type: "integer" } }, - url: "/orgs/:org/hooks/:hook_id" + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events" }, - updateMembership: { + update: { method: "PATCH", params: { - org: { - required: true, + base: { 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"], + body: { type: "string" }, - project_id: { - required: true, + maintainer_can_modify: { + type: "boolean" + }, + number: { + alias: "pull_number", + deprecated: true, type: "integer" }, - username: { + owner: { required: true, type: "string" - } - }, - url: "/projects/:project_id/collaborators/:username" - }, - createCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", - params: { - column_id: { + }, + pull_number: { required: true, type: "integer" }, - content_id: { - type: "integer" + repo: { + required: true, + type: "string" }, - content_type: { + state: { + enum: ["open", "closed"], type: "string" }, - note: { + title: { type: "string" } }, - url: "/projects/columns/:column_id/cards" + url: "/repos/:owner/:repo/pulls/:pull_number" }, - createColumn: { + updateBranch: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.lydian-preview+json" }, - method: "POST", + method: "PUT", params: { - name: { + expected_head_sha: { + type: "string" + }, + owner: { required: true, type: "string" }, - project_id: { + pull_number: { 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: { + repo: { required: true, type: "string" } }, - url: "/user/projects" + url: "/repos/:owner/:repo/pulls/:pull_number/update-branch" }, - createForOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", + updateComment: { + method: "PATCH", params: { body: { + required: true, type: "string" }, - name: { + comment_id: { + required: true, + type: "integer" + }, + owner: { required: true, type: "string" }, - org: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/projects" + url: "/repos/:owner/:repo/pulls/comments/:comment_id" }, - createForRepo: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "POST", + updateReview: { + method: "PUT", params: { body: { - type: "string" - }, - name: { required: true, type: "string" }, + number: { + alias: "pull_number", + deprecated: true, + type: "integer" + }, 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: { + pull_number: { required: true, type: "integer" - } - }, - url: "/projects/:project_id" - }, - deleteCard: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - card_id: { + }, + repo: { required: true, - type: "integer" - } - }, - url: "/projects/columns/cards/:card_id" - }, - deleteColumn: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "DELETE", - params: { - column_id: { + type: "string" + }, + review_id: { required: true, type: "integer" } }, - url: "/projects/columns/:column_id" - }, + url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" + } + }, + rateLimit: { get: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, method: "GET", - params: { - project_id: { - required: true, - type: "integer" - } - }, - url: "/projects/:project_id" - }, - getCard: { + params: {}, + url: "/rate_limit" + } + }, + reactions: { + createForCommitComment: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - card_id: { + comment_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: { + }, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], required: true, - type: "integer" + type: "string" + }, + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/projects/columns/:column_id" + url: "/repos/:owner/:repo/comments/:comment_id/reactions" }, - listCards: { + createForIssue: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - archived_state: { - enum: ["all", "archived", "not_archived"], + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, type: "string" }, - column_id: { + issue_number: { required: true, type: "integer" }, - page: { + number: { + alias: "issue_number", + deprecated: true, type: "integer" }, - per_page: { - type: "integer" + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/projects/columns/:column_id/cards" + url: "/repos/:owner/:repo/issues/:issue_number/reactions" }, - listCollaborators: { + createForIssueComment: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - affiliation: { - enum: ["outside", "direct", "all"], - type: "string" - }, - page: { + comment_id: { + required: true, type: "integer" }, - per_page: { - type: "integer" + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" }, - project_id: { + owner: { required: true, - type: "integer" + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/projects/:project_id/collaborators" + url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions" }, - listColumns: { + createForPullRequestReviewComment: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - page: { + comment_id: { + required: true, type: "integer" }, - per_page: { - type: "integer" + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" }, - project_id: { + owner: { required: true, - type: "integer" + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/projects/:project_id/columns" + url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions" }, - listForOrg: { + createForTeamDiscussion: { + deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)", headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - org: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], required: true, type: "string" }, - page: { + discussion_number: { + required: true, type: "integer" }, - per_page: { + team_id: { + required: true, type: "integer" - }, - state: { - enum: ["open", "closed", "all"], - type: "string" } }, - url: "/orgs/:org/projects" + url: "/teams/:team_id/discussions/:discussion_number/reactions" }, - listForRepo: { + createForTeamDiscussionComment: { + deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)", headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - owner: { + comment_number: { required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { type: "integer" }, - repo: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], required: true, type: "string" }, - state: { - enum: ["open", "closed", "all"], - type: "string" + discussion_number: { + required: true, + type: "integer" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/repos/:owner/:repo/projects" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" }, - listForUser: { + createForTeamDiscussionCommentInOrg: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "POST", params: { - page: { + comment_number: { + required: true, type: "integer" }, - per_page: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" + }, + discussion_number: { + required: true, type: "integer" }, - state: { - enum: ["open", "closed", "all"], + org: { + required: true, type: "string" }, - username: { + team_slug: { required: true, type: "string" } }, - url: "/users/:username/projects" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions" }, - moveCard: { + 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.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, method: "POST", params: { - card_id: { + comment_number: { required: true, type: "integer" }, - column_id: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" + }, + discussion_number: { + required: true, type: "integer" }, - position: { + team_id: { required: true, - type: "string", - validation: "^(top|bottom|after:\\d+)$" + type: "integer" } }, - url: "/projects/columns/cards/:card_id/moves" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" }, - moveColumn: { + createForTeamDiscussionInOrg: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, method: "POST", params: { - column_id: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" + }, + discussion_number: { required: true, type: "integer" }, - position: { + org: { required: true, - type: "string", - validation: "^(first|last|after:\\d+)$" + type: "string" + }, + team_slug: { + required: true, + type: "string" } }, - url: "/projects/columns/:column_id/moves" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" }, - removeCollaborator: { + 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.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "DELETE", + method: "POST", params: { - project_id: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + required: true, + type: "string" + }, + discussion_number: { required: true, type: "integer" }, - username: { + team_id: { required: true, - type: "string" + type: "integer" } }, - url: "/projects/:project_id/collaborators/:username" + url: "/teams/:team_id/discussions/:discussion_number/reactions" }, - reviewUserPermissionLevel: { + delete: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "GET", + method: "DELETE", params: { - project_id: { + reaction_id: { required: true, type: "integer" - }, - username: { - required: true, - type: "string" } }, - url: "/projects/:project_id/collaborators/:username/permission" + url: "/reactions/:reaction_id" }, - update: { + listForCommitComment: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "PATCH", + method: "GET", params: { - body: { - type: "string" + comment_id: { + required: true, + type: "integer" }, - name: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - organization_permission: { + owner: { + required: true, type: "string" }, - private: { - type: "boolean" + page: { + type: "integer" }, - project_id: { - required: true, + per_page: { type: "integer" }, - state: { - enum: ["open", "closed"], + repo: { + required: true, type: "string" } }, - url: "/projects/:project_id" + url: "/repos/:owner/:repo/comments/:comment_id/reactions" }, - updateCard: { + listForIssue: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "PATCH", + method: "GET", params: { - archived: { - type: "boolean" + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + type: "string" }, - card_id: { + issue_number: { required: true, type: "integer" }, - note: { + 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: "/projects/columns/cards/:card_id" + url: "/repos/:owner/:repo/issues/:issue_number/reactions" }, - updateColumn: { + listForIssueComment: { headers: { - accept: "application/vnd.github.inertia-preview+json" + accept: "application/vnd.github.squirrel-girl-preview+json" }, - method: "PATCH", + method: "GET", params: { - column_id: { + comment_id: { required: true, type: "integer" }, - name: { - required: true, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], 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, + page: { + type: "integer" + }, + per_page: { type: "integer" }, repo: { @@ -11932,300 +9119,333 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/merge" + url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions" }, - create: { - method: "POST", + listForPullRequestReviewComment: { + headers: { + accept: "application/vnd.github.squirrel-girl-preview+json" + }, + method: "GET", params: { - base: { + comment_id: { required: true, - type: "string" + type: "integer" }, - body: { + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - draft: { - type: "boolean" - }, - head: { + owner: { required: true, type: "string" }, - maintainer_can_modify: { - type: "boolean" + page: { + type: "integer" }, - owner: { - required: true, - type: "string" + per_page: { + type: "integer" }, repo: { required: true, type: "string" - }, - title: { - required: true, - type: "string" } }, - url: "/repos/:owner/:repo/pulls" + url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions" }, - createComment: { - method: "POST", + 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: { - body: { - required: true, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - commit_id: { + discussion_number: { 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: { + page: { type: "integer" }, - number: { - alias: "pull_number", - deprecated: true, + per_page: { type: "integer" }, - owner: { + 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" }, - path: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - position: { + page: { type: "integer" }, - pull_number: { - required: true, + per_page: { type: "integer" }, - repo: { + team_id: { 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" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" }, - createCommentReply: { - deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)", - method: "POST", + listForTeamDiscussionCommentInOrg: { + headers: { + accept: "application/vnd.github.squirrel-girl-preview+json" + }, + method: "GET", params: { - body: { + comment_number: { required: true, + type: "integer" + }, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - commit_id: { + discussion_number: { + required: true, + type: "integer" + }, + org: { 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.", + page: { type: "integer" }, - line: { + per_page: { type: "integer" }, - number: { - alias: "pull_number", - deprecated: true, + 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" }, - owner: { - required: true, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - path: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - position: { + page: { type: "integer" }, - pull_number: { - required: true, + per_page: { type: "integer" }, - repo: { + 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" }, - side: { - enum: ["LEFT", "RIGHT"], + discussion_number: { + required: true, + type: "integer" + }, + org: { + required: true, type: "string" }, - start_line: { + page: { type: "integer" }, - start_side: { - enum: ["LEFT", "RIGHT", "side"], + per_page: { + type: "integer" + }, + team_slug: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" }, - createFromIssue: { - deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request", - method: "POST", + 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: { - base: { - required: true, + content: { + enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], type: "string" }, - draft: { - type: "boolean" - }, - head: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - issue: { - required: true, + page: { type: "integer" }, - maintainer_can_modify: { - type: "boolean" + per_page: { + type: "integer" }, - owner: { + team_id: { required: true, - type: "string" - }, - repo: { + type: "integer" + } + }, + url: "/teams/:team_id/discussions/:discussion_number/reactions" + } + }, + repos: { + acceptInvitation: { + method: "PATCH", + params: { + invitation_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/pulls" + url: "/user/repository_invitations/:invitation_id" }, - createReview: { - method: "POST", + addCollaborator: { + method: "PUT", params: { - body: { + owner: { + required: true, type: "string" }, - comments: { - type: "object[]" - }, - "comments[].body": { - required: true, + permission: { + enum: ["pull", "push", "admin"], type: "string" }, - "comments[].path": { + repo: { required: true, type: "string" }, - "comments[].position": { + username: { required: true, - type: "integer" - }, - commit_id: { type: "string" - }, - event: { - enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], + } + }, + url: "/repos/:owner/:repo/collaborators/:username" + }, + addDeployKey: { + method: "POST", + params: { + key: { + required: true, type: "string" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, owner: { required: true, type: "string" }, - pull_number: { - required: true, - type: "integer" + read_only: { + type: "boolean" }, repo: { required: true, type: "string" + }, + title: { + type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews" + url: "/repos/:owner/:repo/keys" }, - createReviewCommentReply: { + addProtectedBranchAdminEnforcement: { method: "POST", params: { - body: { + branch: { 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" + url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" }, - createReviewRequest: { + addProtectedBranchAppRestrictions: { method: "POST", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + apps: { + mapTo: "data", + required: true, + type: "string[]" }, - owner: { + branch: { required: true, type: "string" }, - pull_number: { + owner: { required: true, - type: "integer" + type: "string" }, repo: { required: true, type: "string" - }, - reviewers: { - type: "string[]" - }, - team_reviewers: { - type: "string[]" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" }, - deleteComment: { - method: "DELETE", + addProtectedBranchRequiredSignatures: { + headers: { + accept: "application/vnd.github.zzzax-preview+json" + }, + method: "POST", params: { - comment_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -12236,125 +9456,101 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" + url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" }, - deletePendingReview: { - method: "DELETE", + addProtectedBranchRequiredStatusChecksContexts: { + method: "POST", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { + branch: { required: true, type: "string" }, - pull_number: { + contexts: { + mapTo: "data", required: true, - type: "integer" + type: "string[]" }, - repo: { + owner: { required: true, type: "string" }, - review_id: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" }, - deleteReviewRequest: { - method: "DELETE", + addProtectedBranchTeamRestrictions: { + method: "POST", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { + branch: { required: true, type: "string" }, - pull_number: { + owner: { required: true, - type: "integer" + type: "string" }, repo: { required: true, type: "string" }, - reviewers: { - type: "string[]" - }, - team_reviewers: { + teams: { + mapTo: "data", + required: true, type: "string[]" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" }, - dismissReview: { - method: "PUT", + addProtectedBranchUserRestrictions: { + method: "POST", params: { - message: { + branch: { 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: { + users: { + mapTo: "data", required: true, - type: "integer" + type: "string[]" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" }, - get: { + checkCollaborator: { method: "GET", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, owner: { required: true, type: "string" }, - pull_number: { + repo: { required: true, - type: "integer" + type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number" + url: "/repos/:owner/:repo/collaborators/:username" }, - getComment: { + checkVulnerabilityAlerts: { + headers: { + accept: "application/vnd.github.dorian-preview+json" + }, method: "GET", params: { - comment_id: { - required: true, - type: "integer" - }, owner: { required: true, type: "string" @@ -12364,318 +9560,214 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" + url: "/repos/:owner/:repo/vulnerability-alerts" }, - getCommentsForReview: { + compareCommits: { method: "GET", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" - }, - owner: { + base: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { + head: { 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" + url: "/repos/:owner/:repo/compare/:base...:head" }, - list: { - method: "GET", + createCommitComment: { + method: "POST", params: { - base: { + body: { + required: true, type: "string" }, - direction: { - enum: ["asc", "desc"], + commit_sha: { + required: true, type: "string" }, - head: { - type: "string" + line: { + type: "integer" }, owner: { required: true, type: "string" }, - page: { - type: "integer" + path: { + type: "string" }, - per_page: { + position: { type: "integer" }, repo: { required: true, type: "string" }, - sort: { - enum: ["created", "updated", "popularity", "long-running"], - type: "string" - }, - state: { - enum: ["open", "closed", "all"], + sha: { + alias: "commit_sha", + deprecated: true, type: "string" } }, - url: "/repos/:owner/:repo/pulls" + url: "/repos/:owner/:repo/commits/:commit_sha/comments" }, - listComments: { - method: "GET", + createDeployment: { + method: "POST", params: { - direction: { - enum: ["asc", "desc"], + auto_merge: { + type: "boolean" + }, + description: { type: "string" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + environment: { + type: "string" }, owner: { required: true, type: "string" }, - page: { - type: "integer" + payload: { + type: "string" }, - per_page: { - type: "integer" + production_environment: { + type: "boolean" }, - pull_number: { + ref: { required: true, - type: "integer" + type: "string" }, repo: { required: true, type: "string" }, - since: { - type: "string" + required_contexts: { + type: "string[]" }, - sort: { - enum: ["created", "updated"], + task: { type: "string" + }, + transient_environment: { + type: "boolean" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/comments" + url: "/repos/:owner/:repo/deployments" }, - listCommentsForRepo: { - method: "GET", + createDeploymentStatus: { + method: "POST", params: { - direction: { - enum: ["asc", "desc"], - type: "string" + auto_inactive: { + type: "boolean" }, - owner: { + deployment_id: { required: true, - type: "string" - }, - page: { type: "integer" }, - per_page: { - type: "integer" + description: { + type: "string" }, - repo: { - required: true, + environment: { + enum: ["production", "staging", "qa"], type: "string" }, - since: { + environment_url: { type: "string" }, - sort: { - enum: ["created", "updated"], + log_url: { 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: { + state: { + enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"], required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { - required: true, - type: "integer" - }, - repo: { - required: true, + target_url: { type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/files" + url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" }, - listReviewRequests: { - method: "GET", + createDispatchEvent: { + method: "POST", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + client_payload: { + type: "object" }, - owner: { - required: true, + event_type: { type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { + owner: { required: true, - type: "integer" + type: "string" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers" + url: "/repos/:owner/:repo/dispatches" }, - listReviews: { - method: "GET", + createFile: { + deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", + method: "PUT", params: { - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + author: { + type: "object" }, - owner: { + "author.email": { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - pull_number: { + "author.name": { required: true, - type: "integer" + type: "string" }, - repo: { - required: true, + branch: { type: "string" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews" - }, - merge: { - method: "PUT", - params: { - commit_message: { + }, + committer: { + type: "object" + }, + "committer.email": { + required: true, type: "string" }, - commit_title: { + "committer.name": { + required: true, type: "string" }, - merge_method: { - enum: ["merge", "squash", "rebase"], + content: { + required: true, type: "string" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + message: { + required: true, + type: "string" }, owner: { required: true, type: "string" }, - pull_number: { + path: { required: true, - type: "integer" + type: "string" }, repo: { required: true, @@ -12685,116 +9777,112 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number/merge" + url: "/repos/:owner/:repo/contents/:path" }, - submitReview: { + createForAuthenticatedUser: { method: "POST", params: { - body: { - type: "string" + allow_merge_commit: { + type: "boolean" }, - event: { - enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"], - required: true, - type: "string" + allow_rebase_merge: { + type: "boolean" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + allow_squash_merge: { + type: "boolean" }, - owner: { - required: true, - type: "string" + auto_init: { + type: "boolean" }, - pull_number: { - required: true, - type: "integer" + delete_branch_on_merge: { + type: "boolean" }, - repo: { - required: true, + description: { type: "string" }, - review_id: { - required: true, - type: "integer" - } - }, - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events" - }, - update: { - method: "PATCH", - params: { - base: { + gitignore_template: { type: "string" }, - body: { - type: "string" + has_issues: { + type: "boolean" }, - maintainer_can_modify: { + has_projects: { type: "boolean" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + has_wiki: { + type: "boolean" }, - owner: { - required: true, + homepage: { type: "string" }, - pull_number: { - required: true, - type: "integer" + is_template: { + type: "boolean" }, - repo: { - required: true, + license_template: { type: "string" }, - state: { - enum: ["open", "closed"], + name: { + required: true, type: "string" }, - title: { + private: { + type: "boolean" + }, + team_id: { + type: "integer" + }, + visibility: { + enum: ["public", "private", "visibility", "internal"], type: "string" } }, - url: "/repos/:owner/:repo/pulls/:pull_number" + url: "/user/repos" }, - updateBranch: { - headers: { - accept: "application/vnd.github.lydian-preview+json" - }, - method: "PUT", + createFork: { + method: "POST", params: { - expected_head_sha: { + organization: { 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" + url: "/repos/:owner/:repo/forks" }, - updateComment: { - method: "PATCH", + createHook: { + method: "POST", params: { - body: { + active: { + type: "boolean" + }, + config: { required: true, + type: "object" + }, + "config.content_type": { type: "string" }, - comment_id: { + "config.insecure_ssl": { + type: "string" + }, + "config.secret": { + type: "string" + }, + "config.url": { required: true, - type: "integer" + type: "string" + }, + events: { + type: "string[]" + }, + name: { + type: "string" }, owner: { required: true, @@ -12805,144 +9893,165 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id" + url: "/repos/:owner/:repo/hooks" }, - updateReview: { - method: "PUT", + createInOrg: { + method: "POST", params: { - body: { - required: true, + 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" }, - number: { - alias: "pull_number", - deprecated: true, - type: "integer" + gitignore_template: { + type: "string" }, - owner: { - required: true, + has_issues: { + type: "boolean" + }, + has_projects: { + type: "boolean" + }, + has_wiki: { + type: "boolean" + }, + homepage: { type: "string" }, - pull_number: { - required: true, - type: "integer" + is_template: { + type: "boolean" }, - repo: { + license_template: { + type: "string" + }, + name: { required: true, type: "string" }, - review_id: { + org: { required: true, + type: "string" + }, + private: { + type: "boolean" + }, + team_id: { type: "integer" + }, + visibility: { + enum: ["public", "private", "visibility", "internal"], + type: "string" } }, - 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", + url: "/orgs/:org/repos" + }, + createOrUpdateFile: { + method: "PUT", params: { - comment_id: { + author: { + type: "object" + }, + "author.email": { required: true, - type: "integer" + type: "string" }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + "author.name": { required: true, type: "string" }, - owner: { + branch: { + type: "string" + }, + committer: { + type: "object" + }, + "committer.email": { required: true, type: "string" }, - repo: { + "committer.name": { 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: { + message: { required: true, - type: "integer" - }, - number: { - alias: "issue_number", - deprecated: true, - type: "integer" + type: "string" }, owner: { required: true, type: "string" }, + path: { + required: true, + type: "string" + }, repo: { required: true, type: "string" + }, + sha: { + type: "string" } }, - url: "/repos/:owner/:repo/issues/:issue_number/reactions" + url: "/repos/:owner/:repo/contents/:path" }, - createForIssueComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, + createRelease: { method: "POST", params: { - comment_id: { - required: true, - type: "integer" + body: { + type: "string" }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, + 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/issues/comments/:comment_id/reactions" + url: "/repos/:owner/:repo/releases" }, - createForPullRequestReviewComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, + createStatus: { method: "POST", params: { - comment_id: { - required: true, - type: "integer" + context: { + type: "string" }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, + description: { type: "string" }, owner: { @@ -12952,299 +10061,204 @@ var endpointsByScope = { 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"], + }, + sha: { required: true, type: "string" }, - discussion_number: { + state: { + enum: ["error", "failure", "pending", "success"], required: true, - type: "integer" + type: "string" }, - team_id: { - required: true, - type: "integer" + target_url: { + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" + url: "/repos/:owner/:repo/statuses/:sha" }, - createForTeamDiscussionComment: { - deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)", + createUsingTemplate: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.baptiste-preview+json" }, method: "POST", params: { - comment_number: { - required: true, - type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, + description: { 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: { + name: { required: true, - type: "integer" + type: "string" }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, + owner: { type: "string" }, - discussion_number: { - required: true, - type: "integer" + private: { + type: "boolean" }, - org: { + template_owner: { required: true, type: "string" }, - team_slug: { + template_repo: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions" + url: "/repos/:template_owner/:template_repo/generate" }, - 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", + declineInvitation: { + method: "DELETE", params: { - comment_number: { + invitation_id: { required: true, type: "integer" - }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + } + }, + url: "/user/repository_invitations/:invitation_id" + }, + delete: { + method: "DELETE", + params: { + owner: { required: true, type: "string" }, - discussion_number: { - required: true, - type: "integer" - }, - team_id: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" + url: "/repos/:owner/:repo" }, - createForTeamDiscussionInOrg: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "POST", + deleteCommitComment: { + method: "DELETE", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - required: true, - type: "string" - }, - discussion_number: { + comment_id: { required: true, type: "integer" }, - org: { + owner: { required: true, type: "string" }, - team_slug: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" + url: "/repos/:owner/:repo/comments/:comment_id" }, - 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", + deleteDownload: { + method: "DELETE", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + download_id: { required: true, - type: "string" + type: "integer" }, - discussion_number: { + owner: { required: true, - type: "integer" + type: "string" }, - team_id: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" + url: "/repos/:owner/:repo/downloads/:download_id" }, - delete: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, + deleteFile: { 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" + 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" }, - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + message: { + required: true, type: "string" }, owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + path: { + required: true, + type: "string" }, repo: { required: true, type: "string" + }, + sha: { + required: true, + type: "string" } }, - url: "/repos/:owner/:repo/comments/:comment_id/reactions" + url: "/repos/:owner/:repo/contents/:path" }, - listForIssue: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", + deleteHook: { + method: "DELETE", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - issue_number: { + hook_id: { 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" + url: "/repos/:owner/:repo/hooks/:hook_id" }, - listForIssueComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", + deleteInvitation: { + method: "DELETE", params: { - comment_id: { + invitation_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" + url: "/repos/:owner/:repo/invitations/:invitation_id" }, - listForPullRequestReviewComment: { - headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" - }, - method: "GET", + deleteRelease: { + method: "DELETE", 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: { + release_id: { + required: true, type: "integer" }, repo: { @@ -13252,254 +10266,154 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions" + url: "/repos/:owner/:repo/releases/:release_id" }, - 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", + deleteReleaseAsset: { + method: "DELETE", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { + asset_id: { required: true, type: "integer" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + owner: { + required: true, + type: "string" }, - team_id: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/reactions" + url: "/repos/:owner/:repo/releases/assets/:asset_id" }, - listForTeamDiscussionComment: { - deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)", + disableAutomatedSecurityFixes: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.london-preview+json" }, - method: "GET", + method: "DELETE", params: { - comment_number: { + owner: { 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: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" + url: "/repos/:owner/:repo/automated-security-fixes" }, - listForTeamDiscussionCommentInOrg: { + disablePagesSite: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.switcheroo-preview+json" }, - method: "GET", + method: "DELETE", 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: { + owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions" + url: "/repos/:owner/:repo/pages" }, - listForTeamDiscussionCommentLegacy: { - deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy", + disableVulnerabilityAlerts: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.dorian-preview+json" }, - method: "GET", + method: "DELETE", params: { - comment_number: { + owner: { 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: { + repo: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions" + url: "/repos/:owner/:repo/vulnerability-alerts" }, - listForTeamDiscussionInOrg: { + enableAutomatedSecurityFixes: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.london-preview+json" }, - method: "GET", + method: "PUT", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { + owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { + repo: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions" + url: "/repos/:owner/:repo/automated-security-fixes" }, - listForTeamDiscussionLegacy: { - deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy", + enablePagesSite: { headers: { - accept: "application/vnd.github.squirrel-girl-preview+json" + accept: "application/vnd.github.switcheroo-preview+json" }, - method: "GET", + method: "POST", params: { - content: { - enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"], + owner: { + required: true, type: "string" }, - discussion_number: { + repo: { required: true, - type: "integer" + type: "string" }, - page: { - type: "integer" + source: { + type: "object" }, - per_page: { - type: "integer" + "source.branch": { + enum: ["master", "gh-pages"], + type: "string" }, - 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" + "source.path": { + type: "string" } }, - url: "/user/repository_invitations/:invitation_id" + url: "/repos/:owner/:repo/pages" }, - addCollaborator: { + enableVulnerabilityAlerts: { + headers: { + accept: "application/vnd.github.dorian-preview+json" + }, 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" + url: "/repos/:owner/:repo/vulnerability-alerts" }, - addDeployKey: { - method: "POST", + get: { + method: "GET", 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" + url: "/repos/:owner/:repo" }, - addProtectedBranchAdminEnforcement: { - method: "POST", + getAppsWithAccessToProtectedBranch: { + method: "GET", params: { branch: { required: true, @@ -13514,21 +10428,20 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" }, - addProtectedBranchAppRestrictions: { - method: "POST", + getArchiveLink: { + method: "GET", params: { - apps: { - mapTo: "data", + archive_format: { required: true, - type: "string[]" + type: "string" }, - branch: { + owner: { required: true, type: "string" }, - owner: { + ref: { required: true, type: "string" }, @@ -13537,13 +10450,10 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" + url: "/repos/:owner/:repo/:archive_format/:ref" }, - addProtectedBranchRequiredSignatures: { - headers: { - accept: "application/vnd.github.zzzax-preview+json" - }, - method: "POST", + getBranch: { + method: "GET", params: { branch: { required: true, @@ -13558,20 +10468,15 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" + url: "/repos/:owner/:repo/branches/:branch" }, - addProtectedBranchRequiredStatusChecksContexts: { - method: "POST", + getBranchProtection: { + method: "GET", params: { branch: { required: true, type: "string" }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" - }, owner: { required: true, type: "string" @@ -13581,38 +10486,29 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" + url: "/repos/:owner/:repo/branches/:branch/protection" }, - addProtectedBranchTeamRestrictions: { - method: "POST", + getClones: { + method: "GET", params: { - branch: { + owner: { required: true, type: "string" }, - owner: { - required: true, + per: { + enum: ["day", "week"], type: "string" }, repo: { required: true, type: "string" - }, - teams: { - mapTo: "data", - required: true, - type: "string[]" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" + url: "/repos/:owner/:repo/traffic/clones" }, - addProtectedBranchUserRestrictions: { - method: "POST", + getCodeFrequencyStats: { + method: "GET", params: { - branch: { - required: true, - type: "string" - }, owner: { required: true, type: "string" @@ -13620,16 +10516,11 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - users: { - mapTo: "data", - required: true, - type: "string[]" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/repos/:owner/:repo/stats/code_frequency" }, - checkCollaborator: { + getCollaboratorPermissionLevel: { method: "GET", params: { owner: { @@ -13645,105 +10536,97 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/collaborators/:username" + url: "/repos/:owner/:repo/collaborators/:username/permission" }, - checkVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, + getCombinedStatusForRef: { method: "GET", params: { owner: { required: true, type: "string" }, + ref: { + required: true, + type: "string" + }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/vulnerability-alerts" + url: "/repos/:owner/:repo/commits/:ref/status" }, - compareCommits: { + getCommit: { method: "GET", params: { - base: { - required: true, + commit_sha: { + alias: "ref", + deprecated: true, type: "string" }, - head: { + owner: { required: true, type: "string" }, - owner: { + ref: { required: true, type: "string" }, repo: { required: true, type: "string" + }, + sha: { + alias: "ref", + deprecated: true, + type: "string" } }, - url: "/repos/:owner/:repo/compare/:base...:head" + url: "/repos/:owner/:repo/commits/:ref" }, - createCommitComment: { - method: "POST", + getCommitActivityStats: { + method: "GET", params: { - body: { + owner: { required: true, type: "string" }, - commit_sha: { + repo: { required: true, type: "string" - }, - line: { + } + }, + url: "/repos/:owner/:repo/stats/commit_activity" + }, + getCommitComment: { + method: "GET", + params: { + comment_id: { + required: true, 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" + url: "/repos/:owner/:repo/comments/:comment_id" }, - createDeployment: { - method: "POST", + 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: { - 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" @@ -13751,69 +10634,51 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - required_contexts: { - type: "string[]" - }, - task: { - type: "string" - }, - transient_environment: { - type: "boolean" } }, - url: "/repos/:owner/:repo/deployments" + url: "/repos/:owner/:repo/commits/:ref" }, - createDeploymentStatus: { - method: "POST", + getContents: { + method: "GET", params: { - auto_inactive: { - type: "boolean" - }, - deployment_id: { + owner: { required: true, - type: "integer" - }, - description: { - type: "string" - }, - environment: { - enum: ["production", "staging", "qa"], - type: "string" - }, - environment_url: { type: "string" }, - log_url: { + path: { + required: true, type: "string" }, - owner: { - required: true, + ref: { type: "string" }, repo: { required: true, type: "string" - }, - state: { - enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"], + } + }, + url: "/repos/:owner/:repo/contents/:path" + }, + getContributorsStats: { + method: "GET", + params: { + owner: { required: true, type: "string" }, - target_url: { + repo: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" + url: "/repos/:owner/:repo/stats/contributors" }, - createDispatchEvent: { - method: "POST", + getDeployKey: { + method: "GET", params: { - client_payload: { - type: "object" - }, - event_type: { - type: "string" + key_id: { + required: true, + type: "integer" }, owner: { required: true, @@ -13824,128 +10689,87 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/dispatches" + url: "/repos/:owner/:repo/keys/:key_id" }, - createFile: { - deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", - method: "PUT", + getDeployment: { + method: "GET", params: { - author: { - type: "object" - }, - "author.email": { + deployment_id: { required: true, - type: "string" + type: "integer" }, - "author.name": { + owner: { required: true, type: "string" }, - branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { + repo: { required: true, type: "string" - }, - "committer.name": { + } + }, + url: "/repos/:owner/:repo/deployments/:deployment_id" + }, + getDeploymentStatus: { + method: "GET", + params: { + deployment_id: { required: true, - type: "string" + type: "integer" }, - content: { + owner: { required: true, type: "string" }, - message: { + repo: { required: true, type: "string" }, - owner: { + status_id: { required: true, - type: "string" + type: "integer" + } + }, + url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id" + }, + getDownload: { + method: "GET", + params: { + download_id: { + required: true, + type: "integer" }, - path: { + owner: { required: true, type: "string" }, repo: { required: true, type: "string" - }, - sha: { - type: "string" } }, - url: "/repos/:owner/:repo/contents/:path" + url: "/repos/:owner/:repo/downloads/:download_id" }, - createForAuthenticatedUser: { - method: "POST", + getHook: { + method: "GET", 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" + hook_id: { + required: true, + type: "integer" }, - name: { + owner: { required: true, type: "string" }, - private: { - type: "boolean" - }, - team_id: { - type: "integer" - }, - visibility: { - enum: ["public", "private", "visibility", "internal"], + repo: { + required: true, type: "string" } }, - url: "/user/repos" + url: "/repos/:owner/:repo/hooks/:hook_id" }, - createFork: { - method: "POST", + getLatestPagesBuild: { + method: "GET", params: { - organization: { - type: "string" - }, owner: { required: true, type: "string" @@ -13955,37 +10779,25 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/forks" + url: "/repos/:owner/:repo/pages/builds/latest" }, - createHook: { - method: "POST", + getLatestRelease: { + method: "GET", params: { - active: { - type: "boolean" - }, - config: { + owner: { required: true, - type: "object" - }, - "config.content_type": { - type: "string" - }, - "config.insecure_ssl": { - type: "string" - }, - "config.secret": { type: "string" }, - "config.url": { + repo: { required: true, type: "string" - }, - events: { - type: "string[]" - }, - name: { - type: "string" - }, + } + }, + url: "/repos/:owner/:repo/releases/latest" + }, + getPages: { + method: "GET", + params: { owner: { required: true, type: "string" @@ -13995,104 +10807,62 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/hooks" + url: "/repos/:owner/:repo/pages" }, - createInOrg: { - method: "POST", + getPagesBuild: { + method: "GET", 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: { + build_id: { required: true, - type: "string" + type: "integer" }, - org: { + owner: { required: true, type: "string" }, - private: { - type: "boolean" - }, - team_id: { - type: "integer" - }, - visibility: { - enum: ["public", "private", "visibility", "internal"], + repo: { + required: true, type: "string" } }, - url: "/orgs/:org/repos" + url: "/repos/:owner/:repo/pages/builds/:build_id" }, - createOrUpdateFile: { - method: "PUT", + getParticipationStats: { + method: "GET", params: { - author: { - type: "object" - }, - "author.email": { + owner: { required: true, type: "string" }, - "author.name": { + repo: { required: true, type: "string" - }, + } + }, + url: "/repos/:owner/:repo/stats/participation" + }, + getProtectedBranchAdminEnforcement: { + method: "GET", + params: { branch: { - type: "string" - }, - committer: { - type: "object" - }, - "committer.email": { required: true, type: "string" }, - "committer.name": { + owner: { required: true, type: "string" }, - content: { + repo: { required: true, type: "string" - }, - message: { + } + }, + url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" + }, + getProtectedBranchPullRequestReviewEnforcement: { + method: "GET", + params: { + branch: { required: true, type: "string" }, @@ -14100,60 +10870,57 @@ var endpointsByScope = { required: true, type: "string" }, - path: { - required: true, - type: "string" - }, repo: { required: true, type: "string" - }, - sha: { - type: "string" } }, - url: "/repos/:owner/:repo/contents/:path" + url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" }, - createRelease: { - method: "POST", + getProtectedBranchRequiredSignatures: { + headers: { + accept: "application/vnd.github.zzzax-preview+json" + }, + method: "GET", params: { - body: { - type: "string" - }, - draft: { - type: "boolean" - }, - name: { + branch: { + required: true, type: "string" }, owner: { required: true, type: "string" }, - prerelease: { - type: "boolean" - }, repo: { required: true, type: "string" + } + }, + url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" + }, + getProtectedBranchRequiredStatusChecks: { + method: "GET", + params: { + branch: { + required: true, + type: "string" }, - tag_name: { + owner: { required: true, type: "string" }, - target_commitish: { + repo: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo/releases" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" }, - createStatus: { - method: "POST", + getProtectedBranchRestrictions: { + method: "GET", params: { - context: { - type: "string" - }, - description: { + branch: { + required: true, type: "string" }, owner: { @@ -14163,64 +10930,79 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - sha: { + } + }, + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" + }, + getPunchCardStats: { + method: "GET", + params: { + owner: { required: true, type: "string" }, - state: { - enum: ["error", "failure", "pending", "success"], + repo: { required: true, type: "string" - }, - target_url: { - type: "string" } }, - url: "/repos/:owner/:repo/statuses/:sha" + url: "/repos/:owner/:repo/stats/punch_card" }, - createUsingTemplate: { - headers: { - accept: "application/vnd.github.baptiste-preview+json" - }, - method: "POST", + getReadme: { + method: "GET", params: { - description: { + owner: { + required: true, type: "string" }, - name: { - required: true, + ref: { type: "string" }, + repo: { + required: true, + type: "string" + } + }, + url: "/repos/:owner/:repo/readme" + }, + getRelease: { + method: "GET", + params: { owner: { + required: true, type: "string" }, - private: { - type: "boolean" - }, - template_owner: { + release_id: { required: true, - type: "string" + type: "integer" }, - template_repo: { + repo: { required: true, type: "string" } }, - url: "/repos/:template_owner/:template_repo/generate" + url: "/repos/:owner/:repo/releases/:release_id" }, - declineInvitation: { - method: "DELETE", + getReleaseAsset: { + method: "GET", params: { - invitation_id: { + asset_id: { required: true, type: "integer" + }, + owner: { + required: true, + type: "string" + }, + repo: { + required: true, + type: "string" } }, - url: "/user/repository_invitations/:invitation_id" + url: "/repos/:owner/:repo/releases/assets/:asset_id" }, - delete: { - method: "DELETE", + getReleaseByTag: { + method: "GET", params: { owner: { required: true, @@ -14229,16 +11011,20 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + tag: { + required: true, + type: "string" } }, - url: "/repos/:owner/:repo" + url: "/repos/:owner/:repo/releases/tags/:tag" }, - deleteCommitComment: { - method: "DELETE", + getTeamsWithAccessToProtectedBranch: { + method: "GET", params: { - comment_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -14249,15 +11035,11 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/comments/:comment_id" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" }, - deleteDownload: { - method: "DELETE", + getTopPaths: { + method: "GET", params: { - download_id: { - required: true, - type: "integer" - }, owner: { required: true, type: "string" @@ -14267,79 +11049,96 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/downloads/:download_id" + url: "/repos/:owner/:repo/traffic/popular/paths" }, - deleteFile: { - method: "DELETE", + getTopReferrers: { + method: "GET", params: { - author: { - type: "object" - }, - "author.email": { + owner: { + required: true, type: "string" }, - "author.name": { + repo: { + required: true, type: "string" - }, + } + }, + url: "/repos/:owner/:repo/traffic/popular/referrers" + }, + getUsersWithAccessToProtectedBranch: { + method: "GET", + params: { branch: { + required: true, type: "string" }, - committer: { - type: "object" - }, - "committer.email": { - type: "string" - }, - "committer.name": { + owner: { + required: true, type: "string" }, - message: { + repo: { required: true, type: "string" - }, + } + }, + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + }, + getViews: { + method: "GET", + params: { owner: { required: true, type: "string" }, - path: { - required: true, + per: { + enum: ["day", "week"], type: "string" }, repo: { required: true, type: "string" - }, - sha: { - required: true, - type: "string" } }, - url: "/repos/:owner/:repo/contents/:path" + url: "/repos/:owner/:repo/traffic/views" }, - deleteHook: { - method: "DELETE", + list: { + method: "GET", params: { - hook_id: { - required: true, + affiliation: { + type: "string" + }, + direction: { + enum: ["asc", "desc"], + type: "string" + }, + page: { type: "integer" }, - owner: { - required: true, + per_page: { + type: "integer" + }, + sort: { + enum: ["created", "updated", "pushed", "full_name"], + type: "string" + }, + type: { + enum: ["all", "owner", "public", "private", "member"], type: "string" }, - repo: { - required: true, + visibility: { + enum: ["all", "public", "private"], type: "string" } }, - url: "/repos/:owner/:repo/hooks/:hook_id" + url: "/user/repos" }, - deleteInvitation: { - method: "DELETE", + listAppsWithAccessToProtectedBranch: { + deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)", + method: "GET", params: { - invitation_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -14350,15 +11149,21 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/invitations/:invitation_id" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" }, - deleteRelease: { - method: "DELETE", + listAssetsForRelease: { + method: "GET", params: { owner: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, release_id: { required: true, type: "integer" @@ -14368,32 +11173,41 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/releases/:release_id" + url: "/repos/:owner/:repo/releases/:release_id/assets" }, - deleteReleaseAsset: { - method: "DELETE", + listBranches: { + method: "GET", params: { - asset_id: { - required: true, - type: "integer" - }, owner: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + protected: { + type: "boolean" + }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" + url: "/repos/:owner/:repo/branches" }, - disableAutomatedSecurityFixes: { + listBranchesForHeadCommit: { headers: { - accept: "application/vnd.github.london-preview+json" + accept: "application/vnd.github.groot-preview+json" }, - method: "DELETE", + method: "GET", params: { + commit_sha: { + required: true, + type: "string" + }, owner: { required: true, type: "string" @@ -14403,226 +11217,368 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/automated-security-fixes" + url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head" }, - disablePagesSite: { - headers: { - accept: "application/vnd.github.switcheroo-preview+json" - }, - method: "DELETE", + 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/pages" + url: "/repos/:owner/:repo/collaborators" }, - disableVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, - method: "DELETE", + 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/vulnerability-alerts" + url: "/repos/:owner/:repo/commits/:commit_sha/comments" }, - enableAutomatedSecurityFixes: { - headers: { - accept: "application/vnd.github.london-preview+json" - }, - method: "PUT", + 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/automated-security-fixes" + url: "/repos/:owner/:repo/comments" }, - enablePagesSite: { - headers: { - accept: "application/vnd.github.switcheroo-preview+json" - }, - method: "POST", + 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" }, - source: { - type: "object" + sha: { + type: "string" }, - "source.branch": { - enum: ["master", "gh-pages"], + since: { type: "string" }, - "source.path": { + until: { type: "string" } }, - url: "/repos/:owner/:repo/pages" + url: "/repos/:owner/:repo/commits" }, - enableVulnerabilityAlerts: { - headers: { - accept: "application/vnd.github.dorian-preview+json" - }, - method: "PUT", + 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/vulnerability-alerts" + url: "/repos/:owner/:repo/contributors" }, - get: { + 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" + url: "/repos/:owner/:repo/keys" }, - getAppsWithAccessToProtectedBranch: { + listDeploymentStatuses: { method: "GET", params: { - branch: { + deployment_id: { required: true, - type: "string" + type: "integer" }, owner: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" + url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" }, - getArchiveLink: { + listDeployments: { method: "GET", params: { - archive_format: { - required: true, + environment: { type: "string" }, owner: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, ref: { - required: true, type: "string" }, repo: { required: true, type: "string" + }, + sha: { + type: "string" + }, + task: { + type: "string" } }, - url: "/repos/:owner/:repo/:archive_format/:ref" + url: "/repos/:owner/:repo/deployments" }, - getBranch: { + listDownloads: { method: "GET", params: { - branch: { - 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/branches/:branch" + url: "/repos/:owner/:repo/downloads" }, - getBranchProtection: { + listForOrg: { method: "GET", params: { - branch: { + 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/branches/:branch/protection" + url: "/repos/:owner/:repo/forks" }, - getClones: { + listHooks: { method: "GET", params: { owner: { required: true, type: "string" }, - per: { - enum: ["day", "week"], - type: "string" + page: { + type: "integer" + }, + per_page: { + type: "integer" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/traffic/clones" + url: "/repos/:owner/:repo/hooks" }, - getCodeFrequencyStats: { + 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/stats/code_frequency" + url: "/repos/:owner/:repo/invitations" }, - getCollaboratorPermissionLevel: { + listInvitationsForAuthenticatedUser: { + method: "GET", + params: { + page: { + type: "integer" + }, + per_page: { + type: "integer" + } + }, + url: "/user/repository_invitations" + }, + listLanguages: { method: "GET", params: { owner: { @@ -14632,22 +11588,38 @@ var endpointsByScope = { repo: { required: true, type: "string" + } + }, + url: "/repos/:owner/:repo/languages" + }, + listPagesBuilds: { + method: "GET", + params: { + owner: { + required: true, + type: "string" }, - username: { + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/collaborators/:username/permission" + url: "/repos/:owner/:repo/pages/builds" }, - getCombinedStatusForRef: { + listProtectedBranchRequiredStatusChecksContexts: { method: "GET", params: { - owner: { + branch: { required: true, type: "string" }, - ref: { + owner: { required: true, type: "string" }, @@ -14656,79 +11628,121 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/commits/:ref/status" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" }, - getCommit: { + listProtectedBranchTeamRestrictions: { + deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)", method: "GET", params: { - commit_sha: { - alias: "ref", - deprecated: true, + branch: { + required: true, type: "string" }, owner: { required: true, type: "string" }, - ref: { + 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" }, - repo: { + owner: { required: true, type: "string" }, - sha: { - alias: "ref", - deprecated: true, + repo: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo/commits/:ref" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" }, - getCommitActivityStats: { + 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/stats/commit_activity" + url: "/repos/:owner/:repo/commits/:commit_sha/pulls" }, - getCommitComment: { + listReleases: { method: "GET", params: { - comment_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/comments/:comment_id" + url: "/repos/:owner/:repo/releases" }, - 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" - }, + listStatusesForRef: { method: "GET", params: { owner: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, ref: { required: true, type: "string" @@ -14738,49 +11752,55 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/commits/:ref" + url: "/repos/:owner/:repo/commits/:ref/statuses" }, - getContents: { + listTags: { method: "GET", params: { owner: { required: true, type: "string" }, - path: { - required: true, - type: "string" + page: { + type: "integer" }, - ref: { - type: "string" + per_page: { + type: "integer" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/contents/:path" + url: "/repos/:owner/:repo/tags" }, - getContributorsStats: { + 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/stats/contributors" + url: "/repos/:owner/:repo/teams" }, - getDeployKey: { + listTeamsWithAccessToProtectedBranch: { + deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)", method: "GET", params: { - key_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -14791,15 +11811,14 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/keys/:key_id" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" }, - getDeployment: { + listTopics: { + headers: { + accept: "application/vnd.github.mercy-preview+json" + }, method: "GET", params: { - deployment_id: { - required: true, - type: "integer" - }, owner: { required: true, type: "string" @@ -14809,14 +11828,15 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/deployments/:deployment_id" + url: "/repos/:owner/:repo/topics" }, - getDeploymentStatus: { + listUsersWithAccessToProtectedBranch: { + deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)", method: "GET", params: { - deployment_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -14825,20 +11845,23 @@ var endpointsByScope = { repo: { required: true, type: "string" - }, - status_id: { - required: true, - type: "integer" } }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" }, - getDownload: { - method: "GET", + merge: { + method: "POST", params: { - download_id: { + base: { + required: true, + type: "string" + }, + commit_message: { + type: "string" + }, + head: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -14849,10 +11872,10 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/downloads/:download_id" + url: "/repos/:owner/:repo/merges" }, - getHook: { - method: "GET", + pingHook: { + method: "POST", params: { hook_id: { required: true, @@ -14867,25 +11890,15 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/hooks/:hook_id" + url: "/repos/:owner/:repo/hooks/:hook_id/pings" }, - getLatestPagesBuild: { - method: "GET", + removeBranchProtection: { + method: "DELETE", params: { - owner: { + branch: { 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" @@ -14895,10 +11908,10 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/releases/latest" + url: "/repos/:owner/:repo/branches/:branch/protection" }, - getPages: { - method: "GET", + removeCollaborator: { + method: "DELETE", params: { owner: { required: true, @@ -14907,14 +11920,18 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + username: { + required: true, + type: "string" } }, - url: "/repos/:owner/:repo/pages" + url: "/repos/:owner/:repo/collaborators/:username" }, - getPagesBuild: { - method: "GET", + removeDeployKey: { + method: "DELETE", params: { - build_id: { + key_id: { required: true, type: "integer" }, @@ -14927,11 +11944,15 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/pages/builds/:build_id" + url: "/repos/:owner/:repo/keys/:key_id" }, - getParticipationStats: { - method: "GET", + removeProtectedBranchAdminEnforcement: { + method: "DELETE", params: { + branch: { + required: true, + type: "string" + }, owner: { required: true, type: "string" @@ -14941,11 +11962,16 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/stats/participation" + url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" }, - getProtectedBranchAdminEnforcement: { - method: "GET", + removeProtectedBranchAppRestrictions: { + method: "DELETE", params: { + apps: { + mapTo: "data", + required: true, + type: "string[]" + }, branch: { required: true, type: "string" @@ -14959,10 +11985,10 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" }, - getProtectedBranchPullRequestReviewEnforcement: { - method: "GET", + removeProtectedBranchPullRequestReviewEnforcement: { + method: "DELETE", params: { branch: { required: true, @@ -14979,11 +12005,11 @@ var endpointsByScope = { }, url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" }, - getProtectedBranchRequiredSignatures: { + removeProtectedBranchRequiredSignatures: { headers: { accept: "application/vnd.github.zzzax-preview+json" }, - method: "GET", + method: "DELETE", params: { branch: { required: true, @@ -15000,8 +12026,8 @@ var endpointsByScope = { }, url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" }, - getProtectedBranchRequiredStatusChecks: { - method: "GET", + removeProtectedBranchRequiredStatusChecks: { + method: "DELETE", params: { branch: { required: true, @@ -15018,27 +12044,18 @@ var endpointsByScope = { }, url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" }, - getProtectedBranchRestrictions: { - method: "GET", + removeProtectedBranchRequiredStatusChecksContexts: { + method: "DELETE", params: { branch: { required: true, type: "string" }, - owner: { + contexts: { + mapTo: "data", required: true, - type: "string" + type: "string[]" }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" - }, - getPunchCardStats: { - method: "GET", - params: { owner: { required: true, type: "string" @@ -15048,49 +12065,32 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/stats/punch_card" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" }, - getReadme: { - method: "GET", + removeProtectedBranchRestrictions: { + method: "DELETE", params: { - owner: { + branch: { 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" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" }, - getReleaseAsset: { - method: "GET", + removeProtectedBranchTeamRestrictions: { + method: "DELETE", params: { - asset_id: { + branch: { required: true, - type: "integer" + type: "string" }, owner: { required: true, @@ -15099,13 +12099,22 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + teams: { + mapTo: "data", + required: true, + type: "string[]" } }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" }, - getReleaseByTag: { - method: "GET", + removeProtectedBranchUserRestrictions: { + method: "DELETE", params: { + branch: { + required: true, + type: "string" + }, owner: { required: true, type: "string" @@ -15114,16 +12123,22 @@ var endpointsByScope = { required: true, type: "string" }, - tag: { + users: { + mapTo: "data", required: true, - type: "string" + type: "string[]" } }, - url: "/repos/:owner/:repo/releases/tags/:tag" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" }, - getTeamsWithAccessToProtectedBranch: { - method: "GET", + replaceProtectedBranchAppRestrictions: { + method: "PUT", params: { + apps: { + mapTo: "data", + required: true, + type: "string[]" + }, branch: { required: true, type: "string" @@ -15137,25 +12152,20 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" }, - getTopPaths: { - method: "GET", + replaceProtectedBranchRequiredStatusChecksContexts: { + method: "PUT", params: { - owner: { + branch: { required: true, type: "string" }, - repo: { + contexts: { + mapTo: "data", required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/traffic/popular/paths" - }, - getTopReferrers: { - method: "GET", - params: { + type: "string[]" + }, owner: { required: true, type: "string" @@ -15165,10 +12175,10 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/traffic/popular/referrers" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" }, - getUsersWithAccessToProtectedBranch: { - method: "GET", + replaceProtectedBranchTeamRestrictions: { + method: "PUT", params: { branch: { required: true, @@ -15181,66 +12191,47 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + teams: { + mapTo: "data", + required: true, + type: "string[]" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" }, - getViews: { - method: "GET", + replaceProtectedBranchUserRestrictions: { + method: "PUT", params: { - owner: { + branch: { required: true, type: "string" }, - per: { - enum: ["day", "week"], + owner: { + required: true, 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" + users: { + mapTo: "data", + required: true, + type: "string[]" } }, - url: "/user/repos" + url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" }, - listAppsWithAccessToProtectedBranch: { - deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)", - method: "GET", + replaceTopics: { + headers: { + accept: "application/vnd.github.mercy-preview+json" + }, + method: "PUT", params: { - branch: { + names: { required: true, - type: "string" + type: "string[]" }, owner: { required: true, @@ -15251,64 +12242,42 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" + url: "/repos/:owner/:repo/topics" }, - listAssetsForRelease: { - method: "GET", + requestPageBuild: { + method: "POST", 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" + url: "/repos/:owner/:repo/pages/builds" }, - listBranches: { + retrieveCommunityProfileMetrics: { 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" + url: "/repos/:owner/:repo/community/profile" }, - listBranchesForHeadCommit: { - headers: { - accept: "application/vnd.github.groot-preview+json" - }, - method: "GET", + testPushHook: { + method: "POST", params: { - commit_sha: { + hook_id: { required: true, - type: "string" + type: "integer" }, owner: { required: true, @@ -15319,163 +12288,181 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head" + url: "/repos/:owner/:repo/hooks/:hook_id/tests" }, - listCollaborators: { - method: "GET", + transfer: { + method: "POST", params: { - affiliation: { - enum: ["outside", "direct", "all"], + new_owner: { type: "string" }, owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, repo: { required: true, type: "string" + }, + team_ids: { + type: "integer[]" } }, - url: "/repos/:owner/:repo/collaborators" + url: "/repos/:owner/:repo/transfer" }, - listCommentsForCommit: { - method: "GET", + update: { + method: "PATCH", params: { - commit_sha: { - required: true, + allow_merge_commit: { + type: "boolean" + }, + allow_rebase_merge: { + type: "boolean" + }, + allow_squash_merge: { + type: "boolean" + }, + archived: { + type: "boolean" + }, + default_branch: { type: "string" }, - owner: { - required: true, + delete_branch_on_merge: { + type: "boolean" + }, + description: { type: "string" }, - page: { - type: "integer" + has_issues: { + type: "boolean" }, - per_page: { - type: "integer" + has_projects: { + type: "boolean" }, - ref: { - alias: "commit_sha", - deprecated: true, + has_wiki: { + type: "boolean" + }, + homepage: { type: "string" }, - repo: { - required: true, + is_template: { + type: "boolean" + }, + name: { 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" + private: { + type: "boolean" }, repo: { required: true, type: "string" + }, + visibility: { + enum: ["public", "private", "visibility", "internal"], + type: "string" } }, - url: "/repos/:owner/:repo/comments" + url: "/repos/:owner/:repo" }, - listCommits: { - method: "GET", + updateBranchProtection: { + method: "PUT", params: { - author: { - type: "string" + allow_deletions: { + type: "boolean" }, - owner: { + allow_force_pushes: { + allowNull: true, + type: "boolean" + }, + branch: { required: true, type: "string" }, - page: { - type: "integer" + enforce_admins: { + allowNull: true, + required: true, + type: "boolean" }, - path: { + owner: { + required: true, type: "string" }, - per_page: { - type: "integer" - }, repo: { required: true, type: "string" }, - sha: { - type: "string" + required_linear_history: { + type: "boolean" }, - since: { - type: "string" + required_pull_request_reviews: { + allowNull: true, + required: true, + type: "object" }, - until: { - type: "string" - } - }, - url: "/repos/:owner/:repo/commits" - }, - listContributors: { - method: "GET", - params: { - anon: { - type: "string" + "required_pull_request_reviews.dismiss_stale_reviews": { + type: "boolean" }, - owner: { - required: true, - type: "string" + "required_pull_request_reviews.dismissal_restrictions": { + type: "object" }, - page: { - type: "integer" + "required_pull_request_reviews.dismissal_restrictions.teams": { + type: "string[]" }, - per_page: { + "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" }, - repo: { + required_status_checks: { + allowNull: true, required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/contributors" - }, - listDeployKeys: { - method: "GET", - params: { - owner: { + type: "object" + }, + "required_status_checks.contexts": { required: true, - type: "string" + type: "string[]" }, - page: { - type: "integer" + "required_status_checks.strict": { + required: true, + type: "boolean" }, - per_page: { - type: "integer" + restrictions: { + allowNull: true, + required: true, + type: "object" }, - repo: { + "restrictions.apps": { + type: "string[]" + }, + "restrictions.teams": { required: true, - type: "string" + type: "string[]" + }, + "restrictions.users": { + required: true, + type: "string[]" } }, - url: "/repos/:owner/:repo/keys" + url: "/repos/:owner/:repo/branches/:branch/protection" }, - listDeploymentStatuses: { - method: "GET", + updateCommitComment: { + method: "PATCH", params: { - deployment_id: { + body: { + required: true, + type: "string" + }, + comment_id: { required: true, type: "integer" }, @@ -15483,206 +12470,176 @@ var endpointsByScope = { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses" + url: "/repos/:owner/:repo/comments/:comment_id" }, - listDeployments: { - method: "GET", + updateFile: { + deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", + method: "PUT", params: { - environment: { + author: { + type: "object" + }, + "author.email": { + required: true, type: "string" }, - owner: { + "author.name": { required: true, type: "string" }, - page: { - type: "integer" + branch: { + type: "string" }, - per_page: { - type: "integer" + committer: { + type: "object" }, - ref: { + "committer.email": { + required: true, type: "string" }, - repo: { + "committer.name": { required: true, type: "string" }, - sha: { + content: { + required: true, type: "string" }, - task: { + message: { + required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/deployments" - }, - listDownloads: { - method: "GET", - params: { + }, owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + path: { + required: true, + type: "string" }, repo: { required: true, type: "string" + }, + sha: { + type: "string" } }, - url: "/repos/:owner/:repo/downloads" + url: "/repos/:owner/:repo/contents/:path" }, - listForOrg: { - method: "GET", + updateHook: { + method: "PATCH", params: { - direction: { - enum: ["asc", "desc"], - type: "string" + active: { + type: "boolean" }, - org: { - required: true, - type: "string" + add_events: { + type: "string[]" }, - page: { - type: "integer" + config: { + type: "object" }, - per_page: { - type: "integer" + "config.content_type": { + type: "string" }, - sort: { - enum: ["created", "updated", "pushed", "full_name"], + "config.insecure_ssl": { type: "string" }, - type: { - enum: ["all", "public", "private", "forks", "sources", "member", "internal"], + "config.secret": { type: "string" - } - }, - url: "/orgs/:org/repos" - }, - listForUser: { - method: "GET", - params: { - direction: { - enum: ["asc", "desc"], + }, + "config.url": { + required: true, type: "string" }, - page: { - type: "integer" + events: { + type: "string[]" }, - per_page: { + hook_id: { + required: true, type: "integer" }, - sort: { - enum: ["created", "updated", "pushed", "full_name"], + owner: { + required: true, type: "string" }, - type: { - enum: ["all", "owner", "member"], - type: "string" + remove_events: { + type: "string[]" }, - username: { + repo: { required: true, type: "string" } }, - url: "/users/:username/repos" + url: "/repos/:owner/:repo/hooks/:hook_id" }, - listForks: { - method: "GET", + updateInformationAboutPagesSite: { + method: "PUT", params: { + cname: { + type: "string" + }, owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, repo: { required: true, type: "string" }, - sort: { - enum: ["newest", "oldest", "stargazers"], + source: { + enum: ['"gh-pages"', '"master"', '"master /docs"'], type: "string" } }, - url: "/repos/:owner/:repo/forks" + url: "/repos/:owner/:repo/pages" }, - listHooks: { - method: "GET", + updateInvitation: { + method: "PATCH", params: { + invitation_id: { + required: true, + type: "integer" + }, owner: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + permissions: { + enum: ["read", "write", "admin"], + type: "string" }, repo: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/hooks" + url: "/repos/:owner/:repo/invitations/:invitation_id" }, - listInvitations: { - method: "GET", + updateProtectedBranchPullRequestReviewEnforcement: { + method: "PATCH", params: { - owner: { + branch: { required: true, type: "string" }, - page: { - type: "integer" + dismiss_stale_reviews: { + type: "boolean" }, - per_page: { - type: "integer" + dismissal_restrictions: { + type: "object" }, - repo: { - required: true, - type: "string" - } - }, - url: "/repos/:owner/:repo/invitations" - }, - listInvitationsForAuthenticatedUser: { - method: "GET", - params: { - page: { - type: "integer" + "dismissal_restrictions.teams": { + type: "string[]" + }, + "dismissal_restrictions.users": { + type: "string[]" }, - per_page: { - type: "integer" - } - }, - url: "/user/repository_invitations" - }, - listLanguages: { - method: "GET", - params: { owner: { required: true, type: "string" @@ -15690,37 +12647,26 @@ var endpointsByScope = { repo: { required: true, type: "string" - } - }, - url: "/repos/:owner/:repo/languages" - }, - listPagesBuilds: { - method: "GET", - params: { - owner: { - required: true, - type: "string" }, - page: { - type: "integer" + require_code_owner_reviews: { + type: "boolean" }, - per_page: { + required_approving_review_count: { type: "integer" - }, - repo: { - required: true, - type: "string" } }, - url: "/repos/:owner/:repo/pages/builds" + url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" }, - listProtectedBranchRequiredStatusChecksContexts: { - method: "GET", + updateProtectedBranchRequiredStatusChecks: { + method: "PATCH", params: { branch: { required: true, type: "string" }, + contexts: { + type: "string[]" + }, owner: { required: true, type: "string" @@ -15728,35 +12674,60 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + strict: { + type: "boolean" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" + url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" }, - listProtectedBranchTeamRestrictions: { - deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)", - method: "GET", + updateRelease: { + method: "PATCH", params: { - branch: { - required: true, + 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/branches/:branch/protection/restrictions/teams" + url: "/repos/:owner/:repo/releases/:release_id" }, - listProtectedBranchUserRestrictions: { - deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)", - method: "GET", + updateReleaseAsset: { + method: "PATCH", params: { - branch: { + asset_id: { required: true, + type: "integer" + }, + label: { + type: "string" + }, + name: { type: "string" }, owner: { @@ -15768,55 +12739,54 @@ var endpointsByScope = { type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/repos/:owner/:repo/releases/assets/:asset_id" }, - listPublic: { - method: "GET", + uploadReleaseAsset: { + method: "POST", params: { - page: { - type: "integer" + data: { + mapTo: "data", + required: true, + type: "string | object" }, - per_page: { - type: "integer" + file: { + alias: "data", + deprecated: true, + type: "string | object" }, - since: { - type: "integer" - } - }, - url: "/repositories" - }, - listPullRequestsAssociatedWithCommit: { - headers: { - accept: "application/vnd.github.groot-preview+json" - }, - method: "GET", - params: { - commit_sha: { + headers: { required: true, - type: "string" + type: "object" }, - owner: { + "headers.content-length": { + required: true, + type: "integer" + }, + "headers.content-type": { required: true, type: "string" }, - page: { - type: "integer" + label: { + type: "string" }, - per_page: { - type: "integer" + name: { + required: true, + type: "string" }, - repo: { + url: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/commits/:commit_sha/pulls" - }, - listReleases: { + url: ":url" + } + }, + search: { + code: { method: "GET", params: { - owner: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, page: { @@ -15825,18 +12795,25 @@ var endpointsByScope = { per_page: { type: "integer" }, - repo: { + q: { required: true, type: "string" + }, + sort: { + enum: ["indexed"], + type: "string" } }, - url: "/repos/:owner/:repo/releases" + url: "/search/code" }, - listStatusesForRef: { + commits: { + headers: { + accept: "application/vnd.github.cloak-preview+json" + }, method: "GET", params: { - owner: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, page: { @@ -15845,22 +12822,23 @@ var endpointsByScope = { per_page: { type: "integer" }, - ref: { + q: { required: true, type: "string" }, - repo: { - required: true, + sort: { + enum: ["author-date", "committer-date"], type: "string" } }, - url: "/repos/:owner/:repo/commits/:ref/statuses" + url: "/search/commits" }, - listTags: { + issues: { + deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)", method: "GET", params: { - owner: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, page: { @@ -15869,18 +12847,22 @@ var endpointsByScope = { per_page: { type: "integer" }, - repo: { + 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: "/repos/:owner/:repo/tags" + url: "/search/issues" }, - listTeams: { + issuesAndPullRequests: { method: "GET", params: { - owner: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, page: { @@ -15889,331 +12871,285 @@ var endpointsByScope = { 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: { + q: { required: true, type: "string" }, - repo: { - required: true, + sort: { + enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"], type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" + url: "/search/issues" }, - listTopics: { - headers: { - accept: "application/vnd.github.mercy-preview+json" - }, + labels: { method: "GET", params: { - owner: { - required: true, + order: { + enum: ["desc", "asc"], 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: { + q: { required: true, type: "string" }, - owner: { + repository_id: { required: true, - type: "string" + type: "integer" }, - repo: { - required: true, + sort: { + enum: ["created", "updated"], type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/search/labels" }, - merge: { - method: "POST", + repos: { + method: "GET", params: { - base: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, - commit_message: { - type: "string" + page: { + type: "integer" }, - head: { - required: true, - type: "string" + per_page: { + type: "integer" }, - owner: { + q: { required: true, type: "string" }, - repo: { - required: true, + sort: { + enum: ["stars", "forks", "help-wanted-issues", "updated"], type: "string" } }, - url: "/repos/:owner/:repo/merges" + url: "/search/repositories" }, - pingHook: { - method: "POST", + topics: { + method: "GET", params: { - hook_id: { - required: true, - type: "integer" - }, - owner: { - required: true, - type: "string" - }, - repo: { + q: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/hooks/:hook_id/pings" + url: "/search/topics" }, - removeBranchProtection: { - method: "DELETE", + users: { + method: "GET", params: { - branch: { - required: true, + order: { + enum: ["desc", "asc"], type: "string" }, - owner: { + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, + q: { required: true, type: "string" }, - repo: { - required: true, + sort: { + enum: ["followers", "repositories", "joined"], type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection" - }, - removeCollaborator: { - method: "DELETE", + url: "/search/users" + } + }, + teams: { + addMember: { + deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)", + method: "PUT", params: { - owner: { - required: true, - type: "string" - }, - repo: { + team_id: { required: true, - type: "string" + type: "integer" }, username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/collaborators/:username" + url: "/teams/:team_id/members/:username" }, - removeDeployKey: { - method: "DELETE", + addMemberLegacy: { + deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy", + method: "PUT", params: { - key_id: { + team_id: { required: true, type: "integer" }, - owner: { - required: true, - type: "string" - }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/keys/:key_id" + url: "/teams/:team_id/members/:username" }, - removeProtectedBranchAdminEnforcement: { - method: "DELETE", + addOrUpdateMembership: { + deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)", + method: "PUT", params: { - branch: { - required: true, + role: { + enum: ["member", "maintainer"], type: "string" }, - owner: { + team_id: { required: true, - type: "string" + type: "integer" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins" + url: "/teams/:team_id/memberships/:username" }, - removeProtectedBranchAppRestrictions: { - method: "DELETE", + addOrUpdateMembershipInOrg: { + method: "PUT", params: { - apps: { - mapTo: "data", + org: { required: true, - type: "string[]" + type: "string" }, - branch: { - required: true, + role: { + enum: ["member", "maintainer"], type: "string" }, - owner: { + team_slug: { required: true, type: "string" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" + url: "/orgs/:org/teams/:team_slug/memberships/:username" }, - removeProtectedBranchPullRequestReviewEnforcement: { - method: "DELETE", + addOrUpdateMembershipLegacy: { + deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy", + method: "PUT", params: { - branch: { - required: true, + role: { + enum: ["member", "maintainer"], type: "string" }, - owner: { + team_id: { required: true, - type: "string" + type: "integer" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews" + url: "/teams/:team_id/memberships/:username" }, - removeProtectedBranchRequiredSignatures: { + addOrUpdateProject: { + deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)", headers: { - accept: "application/vnd.github.zzzax-preview+json" + accept: "application/vnd.github.inertia-preview+json" }, - method: "DELETE", + method: "PUT", params: { - branch: { - required: true, + permission: { + enum: ["read", "write", "admin"], type: "string" }, - owner: { + project_id: { required: true, - type: "string" + type: "integer" }, - repo: { + team_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures" + url: "/teams/:team_id/projects/:project_id" }, - removeProtectedBranchRequiredStatusChecks: { - method: "DELETE", - params: { - branch: { - required: true, - type: "string" - }, - owner: { - required: true, - type: "string" - }, - repo: { - required: true, - type: "string" - } + addOrUpdateProjectInOrg: { + headers: { + accept: "application/vnd.github.inertia-preview+json" }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" - }, - removeProtectedBranchRequiredStatusChecksContexts: { - method: "DELETE", + method: "PUT", params: { - branch: { + org: { required: true, type: "string" }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" + permission: { + enum: ["read", "write", "admin"], + type: "string" }, - owner: { + project_id: { required: true, - type: "string" + type: "integer" }, - repo: { + team_slug: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" + url: "/orgs/:org/teams/:team_slug/projects/:project_id" }, - removeProtectedBranchRestrictions: { - method: "DELETE", + 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: { - branch: { - required: true, + permission: { + enum: ["read", "write", "admin"], type: "string" }, - owner: { + project_id: { required: true, - type: "string" + type: "integer" }, - repo: { + team_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions" + url: "/teams/:team_id/projects/:project_id" }, - removeProtectedBranchTeamRestrictions: { - method: "DELETE", + addOrUpdateRepo: { + deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)", + method: "PUT", params: { - branch: { + owner: { required: true, type: "string" }, - owner: { - required: true, + permission: { + enum: ["pull", "push", "admin"], type: "string" }, repo: { required: true, type: "string" }, - teams: { - mapTo: "data", + team_id: { required: true, - type: "string[]" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" + url: "/teams/:team_id/repos/:owner/:repo" }, - removeProtectedBranchUserRestrictions: { - method: "DELETE", + addOrUpdateRepoInOrg: { + method: "PUT", params: { - branch: { + org: { required: true, type: "string" }, @@ -16221,53 +13157,48 @@ var endpointsByScope = { required: true, type: "string" }, + permission: { + enum: ["pull", "push", "admin"], + type: "string" + }, repo: { required: true, type: "string" }, - users: { - mapTo: "data", + team_slug: { required: true, - type: "string[]" + type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" }, - replaceProtectedBranchAppRestrictions: { + addOrUpdateRepoLegacy: { + deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy", method: "PUT", params: { - apps: { - mapTo: "data", - required: true, - type: "string[]" - }, - branch: { + owner: { required: true, type: "string" }, - owner: { - required: true, + permission: { + enum: ["pull", "push", "admin"], type: "string" }, repo: { required: true, type: "string" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps" + url: "/teams/:team_id/repos/:owner/:repo" }, - replaceProtectedBranchRequiredStatusChecksContexts: { - method: "PUT", + checkManagesRepo: { + deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)", + method: "GET", params: { - branch: { - required: true, - type: "string" - }, - contexts: { - mapTo: "data", - required: true, - type: "string[]" - }, owner: { required: true, type: "string" @@ -16275,14 +13206,18 @@ var endpointsByScope = { repo: { required: true, type: "string" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts" + url: "/teams/:team_id/repos/:owner/:repo" }, - replaceProtectedBranchTeamRestrictions: { - method: "PUT", + checkManagesRepoInOrg: { + method: "GET", params: { - branch: { + org: { required: true, type: "string" }, @@ -16294,21 +13229,17 @@ var endpointsByScope = { required: true, type: "string" }, - teams: { - mapTo: "data", + team_slug: { required: true, - type: "string[]" + type: "string" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams" + url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" }, - replaceProtectedBranchUserRestrictions: { - method: "PUT", + 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: { - branch: { - required: true, - type: "string" - }, owner: { required: true, type: "string" @@ -16317,578 +13248,547 @@ var endpointsByScope = { required: true, type: "string" }, - users: { - mapTo: "data", + team_id: { required: true, - type: "string[]" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + url: "/teams/:team_id/repos/:owner/:repo" }, - replaceTopics: { - headers: { - accept: "application/vnd.github.mercy-preview+json" - }, - method: "PUT", + create: { + method: "POST", params: { - names: { - required: true, + description: { + type: "string" + }, + maintainers: { type: "string[]" }, - owner: { + name: { required: true, type: "string" }, - repo: { + 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: "/repos/:owner/:repo/topics" + url: "/orgs/:org/teams" }, - requestPageBuild: { + createDiscussion: { + deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)", method: "POST", params: { - owner: { + body: { required: true, type: "string" }, - repo: { + private: { + type: "boolean" + }, + team_id: { + required: true, + type: "integer" + }, + title: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/pages/builds" + url: "/teams/:team_id/discussions" }, - retrieveCommunityProfileMetrics: { - method: "GET", + createDiscussionComment: { + deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)", + method: "POST", params: { - owner: { + body: { required: true, type: "string" }, - repo: { + discussion_number: { required: true, - type: "string" + type: "integer" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/repos/:owner/:repo/community/profile" + url: "/teams/:team_id/discussions/:discussion_number/comments" }, - testPushHook: { + createDiscussionCommentInOrg: { method: "POST", params: { - hook_id: { + body: { + required: true, + type: "string" + }, + discussion_number: { required: true, type: "integer" }, - owner: { + org: { required: true, type: "string" }, - repo: { + team_slug: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/hooks/:hook_id/tests" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments" }, - transfer: { + createDiscussionCommentLegacy: { + deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy", method: "POST", params: { - new_owner: { - type: "string" - }, - owner: { + body: { required: true, type: "string" }, - repo: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - team_ids: { - type: "integer[]" + team_id: { + required: true, + type: "integer" } }, - url: "/repos/:owner/:repo/transfer" + url: "/teams/:team_id/discussions/:discussion_number/comments" }, - update: { - method: "PATCH", + createDiscussionInOrg: { + method: "POST", 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: { + body: { + required: true, type: "string" }, - owner: { + org: { required: true, type: "string" }, private: { type: "boolean" }, - repo: { + team_slug: { required: true, type: "string" }, - visibility: { - enum: ["public", "private", "visibility", "internal"], + title: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo" + url: "/orgs/:org/teams/:team_slug/discussions" }, - updateBranchProtection: { - method: "PUT", + createDiscussionLegacy: { + deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy", + method: "POST", params: { - allow_deletions: { - type: "boolean" - }, - allow_force_pushes: { - allowNull: true, - type: "boolean" - }, - branch: { + body: { required: true, type: "string" }, - enforce_admins: { - allowNull: true, - required: true, + private: { type: "boolean" }, - owner: { + team_id: { required: true, - type: "string" + type: "integer" }, - repo: { + title: { required: true, type: "string" - }, - required_linear_history: { - type: "boolean" - }, - required_pull_request_reviews: { - allowNull: true, + } + }, + 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: "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": { + } + }, + 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: "string[]" + type: "integer" }, - "required_status_checks.strict": { + team_id: { required: true, - type: "boolean" - }, - restrictions: { - allowNull: 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: "object" - }, - "restrictions.apps": { - type: "string[]" + type: "integer" }, - "restrictions.teams": { + discussion_number: { required: true, - type: "string[]" + type: "integer" }, - "restrictions.users": { + team_id: { required: true, - type: "string[]" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" }, - updateCommitComment: { - method: "PATCH", + deleteDiscussionCommentInOrg: { + method: "DELETE", params: { - body: { + comment_number: { required: true, - type: "string" + type: "integer" }, - comment_id: { + discussion_number: { required: true, type: "integer" }, - owner: { + org: { required: true, type: "string" }, - repo: { + team_slug: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/comments/:comment_id" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" }, - updateFile: { - deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)", - method: "PUT", + deleteDiscussionCommentLegacy: { + deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy", + method: "DELETE", params: { - author: { - type: "object" - }, - "author.email": { + comment_number: { required: true, - type: "string" + type: "integer" }, - "author.name": { + discussion_number: { required: true, - type: "string" - }, - branch: { - type: "string" - }, - committer: { - type: "object" + type: "integer" }, - "committer.email": { + team_id: { required: true, - type: "string" - }, - "committer.name": { + type: "integer" + } + }, + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" + }, + deleteDiscussionInOrg: { + method: "DELETE", + params: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - content: { + org: { required: true, type: "string" }, - message: { + team_slug: { required: true, type: "string" - }, - owner: { + } + }, + 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: "string" + type: "integer" }, - path: { + team_id: { required: true, - type: "string" - }, - repo: { + type: "integer" + } + }, + url: "/teams/:team_id/discussions/:discussion_number" + }, + deleteInOrg: { + method: "DELETE", + params: { + org: { required: true, type: "string" }, - sha: { + team_slug: { + required: true, type: "string" } }, - url: "/repos/:owner/:repo/contents/:path" + url: "/orgs/:org/teams/:team_slug" }, - updateHook: { - method: "PATCH", + deleteLegacy: { + deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy", + method: "DELETE", 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": { + team_id: { required: true, - type: "string" - }, - events: { - type: "string[]" - }, - hook_id: { + 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" - }, - owner: { + } + }, + url: "/teams/:team_id" + }, + getByName: { + method: "GET", + params: { + org: { required: true, type: "string" }, - remove_events: { - type: "string[]" - }, - repo: { + team_slug: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/hooks/:hook_id" + url: "/orgs/:org/teams/:team_slug" }, - updateInformationAboutPagesSite: { - method: "PUT", + getDiscussion: { + deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)", + method: "GET", params: { - cname: { - type: "string" - }, - owner: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - repo: { + team_id: { required: true, - type: "string" - }, - source: { - enum: ['"gh-pages"', '"master"', '"master /docs"'], - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/pages" + url: "/teams/:team_id/discussions/:discussion_number" }, - updateInvitation: { - method: "PATCH", + getDiscussionComment: { + deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)", + method: "GET", params: { - invitation_id: { + comment_number: { required: true, type: "integer" }, - owner: { + discussion_number: { required: true, - type: "string" - }, - permissions: { - enum: ["read", "write", "admin"], - type: "string" + type: "integer" }, - repo: { + team_id: { required: true, - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/invitations/:invitation_id" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" }, - updateProtectedBranchPullRequestReviewEnforcement: { - method: "PATCH", + getDiscussionCommentInOrg: { + method: "GET", params: { - branch: { + comment_number: { required: true, - type: "string" - }, - dismiss_stale_reviews: { - type: "boolean" - }, - dismissal_restrictions: { - type: "object" - }, - "dismissal_restrictions.teams": { - type: "string[]" + type: "integer" }, - "dismissal_restrictions.users": { - type: "string[]" + discussion_number: { + required: true, + type: "integer" }, - owner: { + org: { required: true, type: "string" }, - repo: { + team_slug: { 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" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" }, - updateProtectedBranchRequiredStatusChecks: { - method: "PATCH", + getDiscussionCommentLegacy: { + deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy", + method: "GET", params: { - branch: { + comment_number: { required: true, - type: "string" - }, - contexts: { - type: "string[]" + type: "integer" }, - owner: { + discussion_number: { required: true, - type: "string" + type: "integer" }, - repo: { + team_id: { required: true, - type: "string" - }, - strict: { - type: "boolean" + type: "integer" } }, - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks" + url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" }, - updateRelease: { - method: "PATCH", + getDiscussionInOrg: { + method: "GET", params: { - body: { - type: "string" - }, - draft: { - type: "boolean" + discussion_number: { + required: true, + type: "integer" }, - name: { + org: { + required: true, type: "string" }, - owner: { + team_slug: { required: true, type: "string" - }, - prerelease: { - type: "boolean" - }, - release_id: { + } + }, + 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" }, - repo: { + team_id: { required: true, - type: "string" - }, - tag_name: { - type: "string" - }, - target_commitish: { - type: "string" + type: "integer" } }, - url: "/repos/:owner/:repo/releases/:release_id" + url: "/teams/:team_id/discussions/:discussion_number" }, - updateReleaseAsset: { - method: "PATCH", + getLegacy: { + deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy", + method: "GET", params: { - asset_id: { + team_id: { required: true, type: "integer" - }, - label: { - type: "string" - }, - name: { - type: "string" - }, - owner: { + } + }, + 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: "string" + type: "integer" }, - repo: { + username: { required: true, type: "string" } }, - url: "/repos/:owner/:repo/releases/assets/:asset_id" + url: "/teams/:team_id/members/:username" }, - uploadReleaseAsset: { - method: "POST", + getMemberLegacy: { + deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy", + method: "GET", params: { - data: { - mapTo: "data", + team_id: { required: true, - type: "string | object" - }, - file: { - alias: "data", - deprecated: true, - type: "string | object" + type: "integer" }, - headers: { + username: { required: true, - type: "object" - }, - "headers.content-length": { + 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" }, - "headers.content-type": { + username: { + required: true, + type: "string" + } + }, + url: "/teams/:team_id/memberships/:username" + }, + getMembershipInOrg: { + method: "GET", + params: { + org: { required: true, type: "string" }, - label: { + team_slug: { + required: true, type: "string" }, - name: { + 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" }, - url: { + username: { required: true, type: "string" } }, - url: ":url" - } - }, - search: { - code: { + url: "/teams/:team_id/memberships/:username" + }, + list: { method: "GET", params: { - order: { - enum: ["desc", "asc"], + org: { + required: true, type: "string" }, page: { @@ -16896,26 +13796,32 @@ var endpointsByScope = { }, 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" }, - q: { - required: true, - type: "string" + per_page: { + type: "integer" }, - sort: { - enum: ["indexed"], - type: "string" + team_id: { + required: true, + type: "integer" } }, - url: "/search/code" + url: "/teams/:team_id/teams" }, - commits: { - headers: { - accept: "application/vnd.github.cloak-preview+json" - }, + listChildInOrg: { method: "GET", params: { - order: { - enum: ["desc", "asc"], + org: { + required: true, type: "string" }, page: { @@ -16924,47 +13830,68 @@ var endpointsByScope = { per_page: { type: "integer" }, - q: { + 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" }, - sort: { - enum: ["author-date", "committer-date"], - type: "string" + per_page: { + type: "integer" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/search/commits" + url: "/teams/:team_id/teams" }, - issues: { - deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)", + listDiscussionComments: { + deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)", method: "GET", params: { - order: { - enum: ["desc", "asc"], + direction: { + enum: ["asc", "desc"], type: "string" }, + discussion_number: { + required: true, + type: "integer" + }, page: { type: "integer" }, per_page: { type: "integer" }, - q: { + team_id: { 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" + type: "integer" } }, - url: "/search/issues" + url: "/teams/:team_id/discussions/:discussion_number/comments" }, - issuesAndPullRequests: { + listDiscussionCommentsInOrg: { method: "GET", params: { - order: { - enum: ["desc", "asc"], + direction: { + enum: ["asc", "desc"], + type: "string" + }, + discussion_number: { + required: true, + type: "integer" + }, + org: { + required: true, type: "string" }, page: { @@ -16973,44 +13900,44 @@ var endpointsByScope = { per_page: { type: "integer" }, - q: { + team_slug: { 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" + url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments" }, - labels: { + listDiscussionCommentsLegacy: { + deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy", method: "GET", params: { - order: { - enum: ["desc", "asc"], + direction: { + enum: ["asc", "desc"], type: "string" }, - q: { - required: true, - type: "string" + discussion_number: { + required: true, + type: "integer" + }, + page: { + type: "integer" + }, + per_page: { + type: "integer" }, - repository_id: { + team_id: { required: true, type: "integer" - }, - sort: { - enum: ["created", "updated"], - type: "string" } }, - url: "/search/labels" + url: "/teams/:team_id/discussions/:discussion_number/comments" }, - repos: { + listDiscussions: { + deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)", method: "GET", params: { - order: { - enum: ["desc", "asc"], + direction: { + enum: ["asc", "desc"], type: "string" }, page: { @@ -17019,32 +13946,43 @@ var endpointsByScope = { per_page: { type: "integer" }, - q: { + team_id: { required: true, - type: "string" - }, - sort: { - enum: ["stars", "forks", "help-wanted-issues", "updated"], - type: "string" + type: "integer" } }, - url: "/search/repositories" + url: "/teams/:team_id/discussions" }, - topics: { + listDiscussionsInOrg: { method: "GET", params: { - q: { + 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: "/search/topics" + url: "/orgs/:org/teams/:team_slug/discussions" }, - users: { + listDiscussionsLegacy: { + deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy", method: "GET", params: { - order: { - enum: ["desc", "asc"], + direction: { + enum: ["asc", "desc"], type: "string" }, page: { @@ -17053,122 +13991,99 @@ var endpointsByScope = { 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" + url: "/teams/:team_id/discussions" }, - addMemberLegacy: { - deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy", - method: "PUT", + listForAuthenticatedUser: { + method: "GET", params: { - team_id: { - required: true, + page: { type: "integer" }, - username: { - required: true, - type: "string" + per_page: { + type: "integer" } }, - url: "/teams/:team_id/members/:username" + url: "/user/teams" }, - addOrUpdateMembership: { - deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)", - method: "PUT", + 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"], + enum: ["member", "maintainer", "all"], type: "string" }, team_id: { required: true, type: "integer" - }, - username: { - required: true, - type: "string" } }, - url: "/teams/:team_id/memberships/:username" + url: "/teams/:team_id/members" }, - addOrUpdateMembershipInOrg: { - method: "PUT", + listMembersInOrg: { + method: "GET", params: { org: { required: true, type: "string" }, + page: { + type: "integer" + }, + per_page: { + type: "integer" + }, role: { - enum: ["member", "maintainer"], + enum: ["member", "maintainer", "all"], type: "string" }, team_slug: { required: true, type: "string" - }, - username: { - required: true, - type: "string" } }, - url: "/orgs/:org/teams/:team_slug/memberships/:username" + url: "/orgs/:org/teams/:team_slug/members" }, - addOrUpdateMembershipLegacy: { - deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy", - method: "PUT", + 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"], + enum: ["member", "maintainer", "all"], type: "string" }, team_id: { required: true, type: "integer" - }, - username: { - required: true, - type: "string" } }, - url: "/teams/:team_id/memberships/:username" + url: "/teams/:team_id/members" }, - 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", + listPendingInvitations: { + deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)", + method: "GET", params: { - permission: { - enum: ["read", "write", "admin"], - type: "string" + page: { + type: "integer" }, - project_id: { - required: true, + per_page: { type: "integer" }, team_id: { @@ -17176,24 +14091,19 @@ var endpointsByScope = { type: "integer" } }, - url: "/teams/:team_id/projects/:project_id" + url: "/teams/:team_id/invitations" }, - addOrUpdateProjectInOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, - method: "PUT", + listPendingInvitationsInOrg: { + method: "GET", params: { org: { required: true, type: "string" }, - permission: { - enum: ["read", "write", "admin"], - type: "string" + page: { + type: "integer" }, - project_id: { - required: true, + per_page: { type: "integer" }, team_slug: { @@ -17201,21 +14111,16 @@ var endpointsByScope = { type: "string" } }, - url: "/orgs/:org/teams/:team_slug/projects/:project_id" + url: "/orgs/:org/teams/:team_slug/invitations" }, - 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", + listPendingInvitationsLegacy: { + deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy", + method: "GET", params: { - permission: { - enum: ["read", "write", "admin"], - type: "string" + page: { + type: "integer" }, - project_id: { - required: true, + per_page: { type: "integer" }, team_id: { @@ -17223,319 +14128,241 @@ var endpointsByScope = { type: "integer" } }, - url: "/teams/:team_id/projects/:project_id" + url: "/teams/:team_id/invitations" }, - addOrUpdateRepo: { - deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)", - method: "PUT", + 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: { - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/repos/:owner/:repo" + url: "/teams/:team_id/projects" }, - addOrUpdateRepoInOrg: { - method: "PUT", + listProjectsInOrg: { + headers: { + accept: "application/vnd.github.inertia-preview+json" + }, + method: "GET", params: { org: { required: true, type: "string" }, - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_slug: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" + url: "/orgs/:org/teams/:team_slug/projects" }, - addOrUpdateRepoLegacy: { - deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy", - method: "PUT", + 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: { - owner: { - required: true, - type: "string" - }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/repos/:owner/:repo" + url: "/teams/:team_id/projects" }, - checkManagesRepo: { - deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)", + listRepos: { + deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)", method: "GET", params: { - owner: { - required: true, - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/repos/:owner/:repo" + url: "/teams/:team_id/repos" }, - checkManagesRepoInOrg: { + listReposInOrg: { method: "GET", params: { org: { required: true, type: "string" }, - owner: { - required: true, - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_slug: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" + url: "/orgs/:org/teams/:team_slug/repos" }, - checkManagesRepoLegacy: { - deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy", + listReposLegacy: { + deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy", method: "GET", params: { - owner: { - required: true, - type: "string" + page: { + type: "integer" }, - repo: { - required: true, - type: "string" + per_page: { + type: "integer" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/repos/:owner/:repo" + url: "/teams/:team_id/repos" }, - create: { - method: "POST", + removeMember: { + deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)", + method: "DELETE", params: { - description: { - type: "string" - }, - maintainers: { - type: "string[]" - }, - name: { - required: true, - type: "string" - }, - org: { + team_id: { required: true, - type: "string" - }, - parent_team_id: { type: "integer" }, - permission: { - enum: ["pull", "push", "admin"], - type: "string" - }, - privacy: { - enum: ["secret", "closed"], + username: { + required: true, type: "string" - }, - repo_names: { - type: "string[]" } }, - url: "/orgs/:org/teams" + url: "/teams/:team_id/members/:username" }, - createDiscussion: { - deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)", - method: "POST", + removeMemberLegacy: { + deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy", + method: "DELETE", params: { - body: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, team_id: { required: true, type: "integer" }, - title: { + username: { required: true, type: "string" } }, - url: "/teams/:team_id/discussions" + url: "/teams/:team_id/members/:username" }, - createDiscussionComment: { - deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)", - method: "POST", + removeMembership: { + deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)", + method: "DELETE", params: { - body: { - required: true, - type: "string" - }, - discussion_number: { + team_id: { required: true, type: "integer" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments" + url: "/teams/:team_id/memberships/:username" }, - createDiscussionCommentInOrg: { - method: "POST", + removeMembershipInOrg: { + method: "DELETE", params: { - body: { + org: { required: true, type: "string" }, - discussion_number: { - required: true, - type: "integer" - }, - org: { + team_slug: { required: true, type: "string" }, - team_slug: { + username: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments" + url: "/orgs/:org/teams/:team_slug/memberships/:username" }, - createDiscussionCommentLegacy: { - deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy", - method: "POST", + removeMembershipLegacy: { + deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy", + method: "DELETE", params: { - body: { - required: true, - type: "string" - }, - discussion_number: { + team_id: { required: true, type: "integer" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments" + url: "/teams/:team_id/memberships/:username" }, - createDiscussionInOrg: { - method: "POST", + removeProject: { + deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)", + method: "DELETE", params: { - body: { - required: true, - type: "string" - }, - org: { - required: true, - type: "string" - }, - private: { - type: "boolean" - }, - team_slug: { + project_id: { required: true, - type: "string" + type: "integer" }, - title: { + team_id: { required: true, - type: "string" + type: "integer" } }, - url: "/orgs/:org/teams/:team_slug/discussions" + url: "/teams/:team_id/projects/:project_id" }, - createDiscussionLegacy: { - deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy", - method: "POST", + removeProjectInOrg: { + method: "DELETE", params: { - body: { + org: { required: true, type: "string" }, - private: { - type: "boolean" - }, - team_id: { + project_id: { required: true, type: "integer" }, - title: { + team_slug: { 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" + url: "/orgs/:org/teams/:team_slug/projects/:project_id" }, - deleteDiscussion: { - deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)", + removeProjectLegacy: { + deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy", method: "DELETE", params: { - discussion_number: { + project_id: { required: true, type: "integer" }, @@ -17544,39 +14371,39 @@ var endpointsByScope = { type: "integer" } }, - url: "/teams/:team_id/discussions/:discussion_number" + url: "/teams/:team_id/projects/:project_id" }, - deleteDiscussionComment: { - deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)", + removeRepo: { + deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)", method: "DELETE", params: { - comment_number: { + owner: { required: true, - type: "integer" + type: "string" }, - discussion_number: { + repo: { required: true, - type: "integer" + type: "string" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" + url: "/teams/:team_id/repos/:owner/:repo" }, - deleteDiscussionCommentInOrg: { + removeRepoInOrg: { method: "DELETE", params: { - comment_number: { + org: { required: true, - type: "integer" + type: "string" }, - discussion_number: { + owner: { required: true, - type: "integer" + type: "string" }, - org: { + repo: { required: true, type: "string" }, @@ -17585,50 +14412,35 @@ var endpointsByScope = { type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number" + url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo" }, - deleteDiscussionCommentLegacy: { - deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy", + removeRepoLegacy: { + deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy", method: "DELETE", params: { - comment_number: { + owner: { required: true, - type: "integer" + type: "string" }, - discussion_number: { + repo: { required: true, - type: "integer" + type: "string" }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" + url: "/teams/:team_id/repos/:owner/:repo" }, - deleteDiscussionInOrg: { - method: "DELETE", - params: { - discussion_number: { - required: true, - type: "integer" - }, - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - } + reviewProject: { + deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)", + headers: { + accept: "application/vnd.github.inertia-preview+json" }, - 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", + method: "GET", params: { - discussion_number: { + project_id: { required: true, type: "integer" }, @@ -17637,62 +14449,83 @@ var endpointsByScope = { type: "integer" } }, - url: "/teams/:team_id/discussions/:discussion_number" + url: "/teams/:team_id/projects/:project_id" }, - deleteInOrg: { - method: "DELETE", + 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" } }, - url: "/orgs/:org/teams/:team_slug" + url: "/orgs/:org/teams/:team_slug/projects/:project_id" }, - 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" - } + 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" }, - url: "/teams/:team_id" - }, - get: { - deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)", method: "GET", params: { + project_id: { + required: true, + type: "integer" + }, team_id: { required: true, type: "integer" } }, - url: "/teams/:team_id" + url: "/teams/:team_id/projects/:project_id" }, - getByName: { - method: "GET", + update: { + deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)", + method: "PATCH", params: { - org: { - required: true, + description: { type: "string" }, - team_slug: { + 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" } }, - url: "/orgs/:org/teams/:team_slug" + url: "/teams/:team_id" }, - getDiscussion: { - deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)", - method: "GET", + 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" @@ -17700,14 +14533,21 @@ var endpointsByScope = { team_id: { required: true, type: "integer" + }, + title: { + type: "string" } }, url: "/teams/:team_id/discussions/:discussion_number" }, - getDiscussionComment: { - deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)", - method: "GET", + 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" @@ -17723,9 +14563,13 @@ var endpointsByScope = { }, url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" }, - getDiscussionCommentInOrg: { - method: "GET", + updateDiscussionCommentInOrg: { + method: "PATCH", params: { + body: { + required: true, + type: "string" + }, comment_number: { required: true, type: "integer" @@ -17745,10 +14589,14 @@ var endpointsByScope = { }, 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", + 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" @@ -17764,9 +14612,12 @@ var endpointsByScope = { }, url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number" }, - getDiscussionInOrg: { - method: "GET", + updateDiscussionInOrg: { + method: "PATCH", params: { + body: { + type: "string" + }, discussion_number: { required: true, type: "integer" @@ -17778,14 +14629,20 @@ var endpointsByScope = { team_slug: { required: true, type: "string" + }, + title: { + 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", + 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" @@ -17793,372 +14650,264 @@ var endpointsByScope = { team_id: { required: true, type: "integer" + }, + title: { + type: "string" } }, 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", + updateInOrg: { + method: "PATCH", params: { - team_id: { + description: { + type: "string" + }, + name: { 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: { + type: "string" + }, + org: { required: true, + type: "string" + }, + parent_team_id: { type: "integer" }, - username: { + permission: { + enum: ["pull", "push", "admin"], + type: "string" + }, + privacy: { + enum: ["secret", "closed"], + type: "string" + }, + team_slug: { required: true, type: "string" } }, - url: "/teams/:team_id/members/:username" + url: "/orgs/:org/teams/:team_slug" }, - getMemberLegacy: { - deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy", - method: "GET", + updateLegacy: { + deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy", + method: "PATCH", params: { - team_id: { + description: { + type: "string" + }, + name: { required: true, + type: "string" + }, + parent_team_id: { type: "integer" }, - username: { - required: true, + permission: { + enum: ["pull", "push", "admin"], + type: "string" + }, + privacy: { + enum: ["secret", "closed"], type: "string" + }, + team_id: { + required: true, + type: "integer" } }, - url: "/teams/:team_id/members/:username" - }, - getMembership: { - deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)", - method: "GET", + url: "/teams/:team_id" + } + }, + users: { + addEmails: { + method: "POST", params: { - team_id: { + emails: { required: true, - type: "integer" - }, + type: "string[]" + } + }, + url: "/user/emails" + }, + block: { + method: "PUT", + params: { username: { required: true, type: "string" } }, - url: "/teams/:team_id/memberships/:username" + url: "/user/blocks/:username" }, - getMembershipInOrg: { + checkBlocked: { 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" + url: "/user/blocks/:username" }, - getMembershipLegacy: { - deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy", + checkFollowing: { method: "GET", params: { - team_id: { - required: true, - type: "integer" - }, username: { required: true, type: "string" } }, - url: "/teams/:team_id/memberships/:username" + url: "/user/following/:username" }, - list: { + checkFollowingForUser: { method: "GET", params: { - org: { + target_user: { required: true, type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + username: { + required: true, + type: "string" } }, - url: "/orgs/:org/teams" + url: "/users/:username/following/:target_user" }, - listChild: { - deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)", - method: "GET", + createGpgKey: { + method: "POST", params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { - required: true, - type: "integer" + armored_public_key: { + type: "string" } }, - url: "/teams/:team_id/teams" + url: "/user/gpg_keys" }, - listChildInOrg: { - method: "GET", + createPublicKey: { + method: "POST", params: { - org: { - required: true, + key: { type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { - required: true, + title: { type: "string" } }, - url: "/orgs/:org/teams/:team_slug/teams" + url: "/user/keys" }, - listChildLegacy: { - deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy", - method: "GET", + deleteEmails: { + method: "DELETE", params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { + emails: { required: true, - type: "integer" + type: "string[]" } }, - url: "/teams/:team_id/teams" + url: "/user/emails" }, - listDiscussionComments: { - deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)", - method: "GET", + deleteGpgKey: { + method: "DELETE", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { + gpg_key_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments" + url: "/user/gpg_keys/:gpg_key_id" }, - listDiscussionCommentsInOrg: { - method: "GET", + deletePublicKey: { + method: "DELETE", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - org: { + key_id: { 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" + url: "/user/keys/:key_id" }, - listDiscussionCommentsLegacy: { - deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy", - method: "GET", + follow: { + method: "PUT", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - discussion_number: { - required: true, - type: "integer" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions/:discussion_number/comments" + url: "/user/following/:username" }, - listDiscussions: { - deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)", + getAuthenticated: { 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" + params: {}, + url: "/user" }, - listDiscussionsInOrg: { + getByUsername: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], - type: "string" - }, - org: { - required: true, - type: "string" - }, - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - team_slug: { + username: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/discussions" + url: "/users/:username" }, - listDiscussionsLegacy: { - deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy", + getContextForUser: { method: "GET", params: { - direction: { - enum: ["asc", "desc"], + subject_id: { type: "string" }, - page: { - type: "integer" - }, - per_page: { - type: "integer" + subject_type: { + enum: ["organization", "repository", "issue", "pull_request"], + type: "string" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/discussions" + url: "/users/:username/hovercard" }, - listForAuthenticatedUser: { + getGpgKey: { method: "GET", params: { - page: { - type: "integer" - }, - per_page: { + gpg_key_id: { + required: true, 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: { + url: "/user/gpg_keys/:gpg_key_id" + }, + getPublicKey: { + method: "GET", + params: { + key_id: { required: true, type: "integer" } }, - url: "/teams/:team_id/members" + url: "/user/keys/:key_id" }, - listMembersInOrg: { + list: { 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, + since: { type: "string" } }, - url: "/orgs/:org/teams/:team_slug/members" + url: "/users" }, - listMembersLegacy: { - deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy", + listBlocked: { + method: "GET", + params: {}, + url: "/user/blocks" + }, + listEmails: { method: "GET", params: { page: { @@ -18166,20 +14915,11 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - role: { - enum: ["member", "maintainer", "all"], - type: "string" - }, - team_id: { - required: true, - type: "integer" } }, - url: "/teams/:team_id/members" + url: "/user/emails" }, - listPendingInvitations: { - deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)", + listFollowersForAuthenticatedUser: { method: "GET", params: { page: { @@ -18187,36 +14927,27 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - team_id: { - required: true, - type: "integer" } }, - url: "/teams/:team_id/invitations" + url: "/user/followers" }, - listPendingInvitationsInOrg: { + listFollowersForUser: { method: "GET", params: { - org: { - required: true, - type: "string" - }, page: { type: "integer" }, per_page: { type: "integer" }, - team_slug: { + username: { required: true, type: "string" } }, - url: "/orgs/:org/teams/:team_slug/invitations" + url: "/users/:username/followers" }, - listPendingInvitationsLegacy: { - deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy", + listFollowingForAuthenticatedUser: { method: "GET", params: { page: { @@ -18224,19 +14955,11 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - team_id: { - required: true, - type: "integer" } }, - url: "/teams/:team_id/invitations" + url: "/user/following" }, - listProjects: { - deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)", - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, + listFollowingForUser: { method: "GET", params: { page: { @@ -18245,41 +14968,26 @@ var endpointsByScope = { per_page: { type: "integer" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/projects" + url: "/users/:username/following" }, - listProjectsInOrg: { - headers: { - accept: "application/vnd.github.inertia-preview+json" - }, + listGpgKeys: { 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/projects" + url: "/user/gpg_keys" }, - 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" - }, + listGpgKeysForUser: { method: "GET", params: { page: { @@ -18288,15 +14996,14 @@ var endpointsByScope = { per_page: { type: "integer" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/projects" + url: "/users/:username/gpg_keys" }, - listRepos: { - deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)", + listPublicEmails: { method: "GET", params: { page: { @@ -18304,36 +15011,23 @@ var endpointsByScope = { }, per_page: { type: "integer" - }, - team_id: { - required: true, - type: "integer" } }, - url: "/teams/:team_id/repos" + url: "/user/public_emails" }, - listReposInOrg: { + listPublicKeys: { 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/repos" + url: "/user/keys" }, - listReposLegacy: { - deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy", + listPublicKeysForUser: { method: "GET", params: { page: { @@ -18342,15523 +15036,20941 @@ var endpointsByScope = { per_page: { type: "integer" }, - team_id: { + username: { required: true, - type: "integer" + type: "string" } }, - url: "/teams/:team_id/repos" + url: "/users/:username/keys" }, - removeMember: { - deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)", - method: "DELETE", + togglePrimaryEmailVisibility: { + method: "PATCH", params: { - team_id: { + email: { required: true, - type: "integer" + type: "string" }, - username: { + visibility: { required: true, type: "string" } }, - url: "/teams/:team_id/members/:username" + url: "/user/email/visibility" }, - removeMemberLegacy: { - deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy", + unblock: { method: "DELETE", params: { - team_id: { - required: true, - type: "integer" - }, username: { required: true, type: "string" } }, - url: "/teams/:team_id/members/:username" + url: "/user/blocks/:username" }, - removeMembership: { - deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)", + unfollow: { method: "DELETE", params: { - team_id: { - required: true, - type: "integer" - }, username: { required: true, type: "string" } }, - url: "/teams/:team_id/memberships/:username" + 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" + } + } +}; + +const VERSION = "2.4.0"; + +function registerEndpoints(octokit, routes) { + Object.keys(routes).forEach(namespaceName => { + if (!octokit[namespaceName]) { + octokit[namespaceName] = {}; + } + + 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 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()`); + } + + 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; + } + + octokit[namespaceName][apiName] = request; + }); + }); +} + +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]; + } + + delete options[key]; + } + }); + return method(options); + }; + + 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 + */ + +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 + + [["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 + + return octokit[scope]; + } + + }); + }); + return {}; +} +restEndpointMethods.VERSION = VERSION; + +exports.restEndpointMethods = restEndpointMethods; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 537: +/***/ ((__unused_webpack_module, 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__(8932); +var once = _interopDefault(__webpack_require__(1223)); + +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 + + +/***/ }), + +/***/ 6234: +/***/ ((__unused_webpack_module, 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__(9440); +var universalUserAgent = __webpack_require__(5030); +var isPlainObject = __webpack_require__(3287); +var nodeFetch = _interopDefault(__webpack_require__(467)); +var requestError = __webpack_require__(13); + +const VERSION = "5.4.9"; + +function getBufferResponse(response) { + return response.arrayBuffer(); +} + +function fetchWrapper(requestOptions) { + if (isPlainObject.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 + + +/***/ }), + +/***/ 13: +/***/ ((__unused_webpack_module, 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__(8932); +var once = _interopDefault(__webpack_require__(1223)); + +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 + + +/***/ }), + +/***/ 9351: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { requestLog } = __webpack_require__(8883); +const { + restEndpointMethods +} = __webpack_require__(3044); + +const Core = __webpack_require__(9833); + +const CORE_PLUGINS = [ + __webpack_require__(4555), + __webpack_require__(3691), // deprecated: remove in v17 + requestLog, + __webpack_require__(8579), + restEndpointMethods, + __webpack_require__(2657), + + __webpack_require__(2072) // 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; + + +/***/ }), + +/***/ 823: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = Octokit; + +const { request } = __webpack_require__(6234); +const Hook = __webpack_require__(3682); + +const parseClientOptions = __webpack_require__(4613); + +function Octokit(plugins, options) { + options = options || {}; + const hook = new Hook.Collection(); + const log = Object.assign( + { + debug: () => {}, + info: () => {}, + warn: console.warn, + error: console.error }, - removeMembershipInOrg: { - method: "DELETE", - params: { - org: { - required: true, - type: "string" - }, - team_slug: { - required: true, - type: "string" - }, - username: { - required: true, - type: "string" + options && options.log + ); + const api = { + hook, + log, + request: request.defaults(parseClientOptions(options, log, hook)) + }; + + plugins.forEach(pluginFunction => pluginFunction(api, options)); + + return api; +} + + +/***/ }), + +/***/ 9833: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const factory = __webpack_require__(5320); + +module.exports = factory(); + + +/***/ }), + +/***/ 5320: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = factory; + +const Octokit = __webpack_require__(823); +const registerPlugin = __webpack_require__(7826); + +function factory(plugins) { + const Api = Octokit.bind(null, plugins || []); + Api.plugin = registerPlugin.bind(null, plugins || []); + return Api; +} + + +/***/ }), + +/***/ 4613: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = parseOptions; + +const { Deprecation } = __webpack_require__(8932); +const { getUserAgent } = __webpack_require__(3318); +const once = __webpack_require__(1223); + +const pkg = __webpack_require__(9674); + +const deprecateOptionsTimeout = once((log, deprecation) => + log.warn(deprecation) +); +const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation)); +const deprecateOptionsHeaders = once((log, deprecation) => + log.warn(deprecation) +); + +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; + }, {}); + } + + const clientDefaults = { + headers: options.headers || {}, + request: options.request || {}, + mediaType: { + previews: [], + format: "" + } + }; + + if (options.baseUrl) { + clientDefaults.baseUrl = options.baseUrl; + } + + if (options.userAgent) { + clientDefaults.headers["user-agent"] = options.userAgent; + } + + if (options.previews) { + clientDefaults.mediaType.previews = options.previews; + } + + if (options.timeZone) { + clientDefaults.headers["time-zone"] = options.timeZone; + } + + 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; + } + + 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; + } + + 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" + ) + ); + } + + const userAgentOption = clientDefaults.headers["user-agent"]; + const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`; + + clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent] + .filter(Boolean) + .join(" "); + + clientDefaults.request.hook = hook.bind(null, "request"); + + return clientDefaults; +} + + +/***/ }), + +/***/ 7826: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = registerPlugin; + +const factory = __webpack_require__(5320); + +function registerPlugin(plugins, pluginFunction) { + return factory( + plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction) + ); +} + + +/***/ }), + +/***/ 3318: +/***/ ((__unused_webpack_module, 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__(4824)); + +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 + + +/***/ }), + +/***/ 795: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticate; + +const { Deprecation } = __webpack_require__(8932); +const once = __webpack_require__(1223); + +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; +} + + +/***/ }), + +/***/ 7578: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationBeforeRequest; + +const btoa = __webpack_require__(2358); +const uniq = __webpack_require__(8216); + +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}`; +} + + +/***/ }), + +/***/ 3691: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationPlugin; + +const { Deprecation } = __webpack_require__(8932); +const once = __webpack_require__(1223); + +const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation)); + +const authenticate = __webpack_require__(795); +const beforeRequest = __webpack_require__(7578); +const requestError = __webpack_require__(4275); + +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; + } + 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)); +} + + +/***/ }), + +/***/ 4275: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationRequestError; + +const { RequestError } = __webpack_require__(537); + +function authenticationRequestError(state, error, options) { + /* istanbul ignore next */ + if (!error.headers) throw error; + + const otpRequired = /required/.test(error.headers["x-github-otp"] || ""); + // handle "2FA required" error only + if (error.status !== 401 || !otpRequired) { + throw error; + } + + 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 + } + ); + } + + 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 + } + ); + } + + 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); + }); +} + + +/***/ }), + +/***/ 9733: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationBeforeRequest; + +const btoa = __webpack_require__(2358); + +const withAuthorizationPrefix = __webpack_require__(9603); + +function authenticationBeforeRequest(state, options) { + if (typeof state.auth === "string") { + options.headers.authorization = withAuthorizationPrefix(state.auth); + return; + } + + 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; + } + + 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; + } + + options.url += options.url.indexOf("?") === -1 ? "?" : "&"; + options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`; + return; + } + + return Promise.resolve() + + .then(() => { + return state.auth(); + }) + + .then(authorization => { + options.headers.authorization = withAuthorizationPrefix(authorization); + }); +} + + +/***/ }), + +/***/ 4555: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationPlugin; + +const { createTokenAuth } = __webpack_require__(334); +const { Deprecation } = __webpack_require__(8932); +const once = __webpack_require__(1223); + +const beforeRequest = __webpack_require__(9733); +const requestError = __webpack_require__(3217); +const validate = __webpack_require__(8997); +const withAuthorizationPrefix = __webpack_require__(9603); + +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)); +} + + +/***/ }), + +/***/ 3217: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = authenticationRequestError; + +const { RequestError } = __webpack_require__(537); + +function authenticationRequestError(state, error, options) { + if (!error.headers) throw error; + + const otpRequired = /required/.test(error.headers["x-github-otp"] || ""); + // handle "2FA required" error only + if (error.status !== 401 || !otpRequired) { + throw error; + } + + 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 } - }, - 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" + ); + } + } + + 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 + } + ); + } + + 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; + }); + }); +} + + +/***/ }), + +/***/ 8997: +/***/ ((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)}`); +} + + +/***/ }), + +/***/ 9603: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = withAuthorizationPrefix; + +const atob = __webpack_require__(5224); + +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}`; +} + + +/***/ }), + +/***/ 8579: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = paginatePlugin; + +const { paginateRest } = __webpack_require__(4193); + +function paginatePlugin(octokit) { + Object.assign(octokit, paginateRest(octokit)); +} + + +/***/ }), + +/***/ 2657: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = octokitValidate; + +const validate = __webpack_require__(6132); + +function octokitValidate(octokit) { + octokit.hook.before("request", validate.bind(null, octokit)); +} + + +/***/ }), + +/***/ 6132: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +module.exports = validate; + +const { RequestError } = __webpack_require__(537); +const get = __webpack_require__(9197); +const set = __webpack_require__(1552); + +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); + } + + const values = parentParameterIsArray + ? (get(options, parentParameterName) || []).map( + value => value[parameterName.split(/\./).pop()] + ) + : [get(options, parameterName)]; + + values.forEach((value, i) => { + const valueIsPresent = typeof value !== "undefined"; + const valueIsNull = value === null; + const currentParameterName = parentParameterIsArray + ? parameterName.replace(/\[\]/, `[${i}]`) + : parameterName; + + if (!parameter.required && !valueIsPresent) { + return; + } + + // if the parent parameter is of type object but allows null + // then the child parameters can be ignored + if (!parentParamIsPresent) { + return; + } + + if (parameter.allowNull && valueIsNull) { + return; + } + + if (!parameter.allowNull && valueIsNull) { + throw new RequestError( + `'${currentParameterName}' cannot be null`, + 400, + { + request: options + } + ); + } + + if (parameter.required && !valueIsPresent) { + throw new RequestError( + `Empty value for parameter '${currentParameterName}': ${JSON.stringify( + value + )}`, + 400, + { + request: options + } + ); + } + + // 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 + } + ); } - }, - 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 (parameter.enum && parameter.enum.indexOf(String(value)) === -1) { + throw new RequestError( + `Invalid value for parameter '${currentParameterName}': ${JSON.stringify( + value + )}`, + 400, + { + request: options + } + ); + } + + 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 + } + ); } - }, - 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 (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 + } + ); } - }, - 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" + } + + set(options, parameter.mapTo || currentParameterName, value); + }); + }); + + return options; +} + + +/***/ }), + +/***/ 5224: +/***/ ((module) => { + +module.exports = function atob(str) { + return Buffer.from(str, 'base64').toString('binary') +} + + +/***/ }), + +/***/ 4599: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +__webpack_require__(3639); +var AWS = __webpack_require__(8437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['codedeploy'] = {}; +AWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']); +Object.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', { + get: function get() { + var model = __webpack_require__(3531); + model.paginators = __webpack_require__(3203)/* .pagination */ .o; + model.waiters = __webpack_require__(6338)/* .waiters */ .V; + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CodeDeploy; + + +/***/ }), + +/***/ 8291: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +__webpack_require__(3639); +var AWS = __webpack_require__(8437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['cognitoidentity'] = {}; +AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); +__webpack_require__(4074); +Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { + get: function get() { + var model = __webpack_require__(6102); + model.paginators = __webpack_require__(796)/* .pagination */ .o; + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CognitoIdentity; + + +/***/ }), + +/***/ 7513: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +__webpack_require__(3639); +var AWS = __webpack_require__(8437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['sts'] = {}; +AWS.STS = Service.defineService('sts', ['2011-06-15']); +__webpack_require__(1055); +Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { + get: function get() { + var model = __webpack_require__(8976); + model.paginators = __webpack_require__(2952)/* .pagination */ .o; + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.STS; + + +/***/ }), + +/***/ 2793: +/***/ ((module) => { + +function apiLoader(svc, version) { + if (!apiLoader.services.hasOwnProperty(svc)) { + throw new Error('InvalidService: Failed to load api for ' + svc); + } + return apiLoader.services[svc][version]; +} + +/** + * @api private + * + * This member of AWS.apiLoader is private, but changing it will necessitate a + * change to ../scripts/services-table-generator.ts + */ +apiLoader.services = {}; + +/** + * @api private + */ +module.exports = apiLoader; + + +/***/ }), + +/***/ 8110: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +__webpack_require__(3819); +__webpack_require__(6965); +var PromisesDependency; + +/** + * The main configuration class used by all service objects to set + * the region, credentials, and other options for requests. + * + * By default, credentials and region settings are left unconfigured. + * This should be configured by the application before using any + * AWS service APIs. + * + * In order to set global configuration options, properties should + * be assigned to the global {AWS.config} object. + * + * @see AWS.config + * + * @!group General Configuration Options + * + * @!attribute credentials + * @return [AWS.Credentials] the AWS credentials to sign requests with. + * + * @!attribute region + * @example Set the global region setting to us-west-2 + * AWS.config.update({region: 'us-west-2'}); + * @return [AWS.Credentials] The region to send service requests to. + * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html + * A list of available endpoints for each AWS service + * + * @!attribute maxRetries + * @return [Integer] the maximum amount of retries to perform for a + * service request. By default this value is calculated by the specific + * service object that the request is being made to. + * + * @!attribute maxRedirects + * @return [Integer] the maximum amount of redirects to follow for a + * service request. Defaults to 10. + * + * @!attribute paramValidation + * @return [Boolean|map] whether input parameters should be validated against + * the operation description before sending the request. Defaults to true. + * Pass a map to enable any of the following specific validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. + * + * @!attribute computeChecksums + * @return [Boolean] whether to compute checksums for payload bodies when + * the service accepts it (currently supported in S3 only). + * + * @!attribute convertResponseTypes + * @return [Boolean] whether types are converted when parsing response data. + * Currently only supported for JSON based services. Turning this off may + * improve performance on large response payloads. Defaults to `true`. + * + * @!attribute correctClockSkew + * @return [Boolean] whether to apply a clock skew correction and retry + * requests that fail because of an skewed client clock. Defaults to + * `false`. + * + * @!attribute sslEnabled + * @return [Boolean] whether SSL is enabled for requests + * + * @!attribute s3ForcePathStyle + * @return [Boolean] whether to force path style URLs for S3 objects + * + * @!attribute s3BucketEndpoint + * @note Setting this configuration option requires an `endpoint` to be + * provided explicitly to the service constructor. + * @return [Boolean] whether the provided endpoint addresses an individual + * bucket (false if it addresses the root API endpoint). + * + * @!attribute s3DisableBodySigning + * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. + * Body signing can only be disabled when using https. Defaults to `true`. + * + * @!attribute s3UsEast1RegionalEndpoint + * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 + * request to global endpoints or 'us-east-1' regional endpoints. This config is only + * applicable to S3 client; + * Defaults to 'legacy' + * @!attribute s3UseArnRegion + * @return [Boolean] whether to override the request region with the region inferred + * from requested resource's ARN. Only available for S3 buckets + * Defaults to `true` + * + * @!attribute useAccelerateEndpoint + * @note This configuration option is only compatible with S3 while accessing + * dns-compatible buckets. + * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. + * Defaults to `false`. + * + * @!attribute retryDelayOptions + * @example Set the base retry delay for all services to 300 ms + * AWS.config.update({retryDelayOptions: {base: 300}}); + * // Delays with maxRetries = 3: 300, 600, 1200 + * @example Set a custom backoff function to provide delay values on retries + * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { + * // returns delay in ms + * }}}); + * @return [map] A set of options to configure the retry delay on retryable errors. + * Currently supported options are: + * + * * **base** [Integer] — The base number of milliseconds to use in the + * exponential backoff for operation retries. Defaults to 100 ms for all services except + * DynamoDB, where it defaults to 50ms. + * + * * **customBackoff ** [function] — A custom function that accepts a + * retry count and error and returns the amount of time to delay in + * milliseconds. If the result is a non-zero negative value, no further + * retry attempts will be made. The `base` option will be ignored if this + * option is supplied. + * + * @!attribute httpOptions + * @return [map] A set of options to pass to the low-level HTTP request. + * Currently supported options are: + * + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only supported in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — Sets the socket to timeout after timeout + * milliseconds of inactivity on the socket. Defaults to two minutes + * (120000) + * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous + * HTTP requests. Used in the browser environment only. Set to false to + * send requests synchronously. Defaults to true (async on). + * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" + * property of an XMLHttpRequest object. Used in the browser environment + * only. Defaults to false. + * @!attribute logger + * @return [#write,#log] an object that responds to .write() (like a stream) + * or .log() (like the console object) in order to log information about + * requests + * + * @!attribute systemClockOffset + * @return [Number] an offset value in milliseconds to apply to all signing + * times. Use this to compensate for clock skew when your system may be + * out of sync with the service time. Note that this configuration option + * can only be applied to the global `AWS.config` object and cannot be + * overridden in service-specific configuration. Defaults to 0 milliseconds. + * + * @!attribute signatureVersion + * @return [String] the signature version to sign requests with (overriding + * the API configuration). Possible values are: 'v2', 'v3', 'v4'. + * + * @!attribute signatureCache + * @return [Boolean] whether the signature to sign requests with (overriding + * the API configuration) is cached. Only applies to the signature version 'v4'. + * Defaults to `true`. + * + * @!attribute endpointDiscoveryEnabled + * @return [Boolean|undefined] whether to call operations with endpoints + * given by service dynamically. Setting this config to `true` will enable + * endpoint discovery for all applicable operations. Setting it to `false` + * will explicitly disable endpoint discovery even though operations that + * require endpoint discovery will presumably fail. Leaving it to + * `undefined` means SDK only do endpoint discovery when it's required. + * Defaults to `undefined` + * + * @!attribute endpointCacheSize + * @return [Number] the size of the global cache storing endpoints from endpoint + * discovery operations. Once endpoint cache is created, updating this setting + * cannot change existing cache size. + * Defaults to 1000 + * + * @!attribute hostPrefixEnabled + * @return [Boolean] whether to marshal request parameters to the prefix of + * hostname. Defaults to `true`. + * + * @!attribute stsRegionalEndpoints + * @return ['legacy'|'regional'] whether to send sts request to global endpoints or + * regional endpoints. + * Defaults to 'legacy' + */ +AWS.Config = AWS.util.inherit({ + /** + * @!endgroup + */ + + /** + * Creates a new configuration object. This is the object that passes + * option data along to service requests, including credentials, security, + * region information, and some service specific settings. + * + * @example Creating a new configuration object with credentials and region + * var config = new AWS.Config({ + * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' + * }); + * @option options accessKeyId [String] your AWS access key ID. + * @option options secretAccessKey [String] your AWS secret access key. + * @option options sessionToken [AWS.Credentials] the optional AWS + * session token to sign requests with. + * @option options credentials [AWS.Credentials] the AWS credentials + * to sign requests with. You can either specify this object, or + * specify the accessKeyId and secretAccessKey options directly. + * @option options credentialProvider [AWS.CredentialProviderChain] the + * provider chain used to resolve credentials if no static `credentials` + * property is set. + * @option options region [String] the region to send service requests to. + * See {region} for more information. + * @option options maxRetries [Integer] the maximum amount of retries to + * attempt with a request. See {maxRetries} for more information. + * @option options maxRedirects [Integer] the maximum amount of redirects to + * follow with a request. See {maxRedirects} for more information. + * @option options sslEnabled [Boolean] whether to enable SSL for + * requests. + * @option options paramValidation [Boolean|map] whether input parameters + * should be validated against the operation description before sending + * the request. Defaults to true. Pass a map to enable any of the + * following specific validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. + * @option options computeChecksums [Boolean] whether to compute checksums + * for payload bodies when the service accepts it (currently supported + * in S3 only) + * @option options convertResponseTypes [Boolean] whether types are converted + * when parsing response data. Currently only supported for JSON based + * services. Turning this off may improve performance on large response + * payloads. Defaults to `true`. + * @option options correctClockSkew [Boolean] whether to apply a clock skew + * correction and retry requests that fail because of an skewed client + * clock. Defaults to `false`. + * @option options s3ForcePathStyle [Boolean] whether to force path + * style URLs for S3 objects. + * @option options s3BucketEndpoint [Boolean] whether the provided endpoint + * addresses an individual bucket (false if it addresses the root API + * endpoint). Note that setting this configuration option requires an + * `endpoint` to be provided explicitly to the service constructor. + * @option options s3DisableBodySigning [Boolean] whether S3 body signing + * should be disabled when using signature version `v4`. Body signing + * can only be disabled when using https. Defaults to `true`. + * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region + * is set to 'us-east-1', whether to send s3 request to global endpoints or + * 'us-east-1' regional endpoints. This config is only applicable to S3 client. + * Defaults to `legacy` + * @option options s3UseArnRegion [Boolean] whether to override the request region + * with the region inferred from requested resource's ARN. Only available for S3 buckets + * Defaults to `true` + * + * @option options retryDelayOptions [map] A set of options to configure + * the retry delay on retryable errors. Currently supported options are: + * + * * **base** [Integer] — The base number of milliseconds to use in the + * exponential backoff for operation retries. Defaults to 100 ms for all + * services except DynamoDB, where it defaults to 50ms. + * * **customBackoff ** [function] — A custom function that accepts a + * retry count and error and returns the amount of time to delay in + * milliseconds. If the result is a non-zero negative value, no further + * retry attempts will be made. The `base` option will be ignored if this + * option is supplied. + * @option options httpOptions [map] A set of options to pass to the low-level + * HTTP request. Currently supported options are: + * + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Defaults to the global + * agent (`http.globalAgent`) for non-SSL connections. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only available in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — Sets the socket to timeout after timeout + * milliseconds of inactivity on the socket. Defaults to two minutes + * (120000). + * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous + * HTTP requests. Used in the browser environment only. Set to false to + * send requests synchronously. Defaults to true (async on). + * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" + * property of an XMLHttpRequest object. Used in the browser environment + * only. Defaults to false. + * @option options apiVersion [String, Date] a String in YYYY-MM-DD format + * (or a date) that represents the latest possible API version that can be + * used in all services (unless overridden by `apiVersions`). Specify + * 'latest' to use the latest possible version. + * @option options apiVersions [map] a map of service + * identifiers (the lowercase service class name) with the API version to + * use when instantiating a service. Specify 'latest' for each individual + * that can use the latest available version. + * @option options logger [#write,#log] an object that responds to .write() + * (like a stream) or .log() (like the console object) in order to log + * information about requests + * @option options systemClockOffset [Number] an offset value in milliseconds + * to apply to all signing times. Use this to compensate for clock skew + * when your system may be out of sync with the service time. Note that + * this configuration option can only be applied to the global `AWS.config` + * object and cannot be overridden in service-specific configuration. + * Defaults to 0 milliseconds. + * @option options signatureVersion [String] the signature version to sign + * requests with (overriding the API configuration). Possible values are: + * 'v2', 'v3', 'v4'. + * @option options signatureCache [Boolean] whether the signature to sign + * requests with (overriding the API configuration) is cached. Only applies + * to the signature version 'v4'. Defaults to `true`. + * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 + * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. + * @option options useAccelerateEndpoint [Boolean] Whether to use the + * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. + * @option options clientSideMonitoring [Boolean] whether to collect and + * publish this client's performance metrics of all its API requests. + * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to + * call operations with endpoints given by service dynamically. Setting this + * config to `true` will enable endpoint discovery for all applicable operations. + * Setting it to `false` will explicitly disable endpoint discovery even though + * operations that require endpoint discovery will presumably fail. Leaving it + * to `undefined` means SDK will only do endpoint discovery when it's required. + * Defaults to `undefined` + * @option options endpointCacheSize [Number] the size of the global cache storing + * endpoints from endpoint discovery operations. Once endpoint cache is created, + * updating this setting cannot change existing cache size. + * Defaults to 1000 + * @option options hostPrefixEnabled [Boolean] whether to marshal request + * parameters to the prefix of hostname. + * Defaults to `true`. + * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request + * to global endpoints or regional endpoints. + * Defaults to 'legacy'. + */ + constructor: function Config(options) { + if (options === undefined) options = {}; + options = this.extractCredentials(options); + + AWS.util.each.call(this, this.keys, function (key, value) { + this.set(key, options[key], value); + }); + }, + + /** + * @!group Managing Credentials + */ + + /** + * Loads credentials from the configuration object. This is used internally + * by the SDK to ensure that refreshable {Credentials} objects are properly + * refreshed and loaded when sending a request. If you want to ensure that + * your credentials are loaded prior to a request, you can use this method + * directly to provide accurate credential data stored in the object. + * + * @note If you configure the SDK with static or environment credentials, + * the credential data should already be present in {credentials} attribute. + * This method is primarily necessary to load credentials from asynchronous + * sources, or sources that can refresh credentials periodically. + * @example Getting your access key + * AWS.config.getCredentials(function(err) { + * if (err) console.log(err.stack); // credentials not loaded + * else console.log("Access Key:", AWS.config.credentials.accessKeyId); + * }) + * @callback callback function(err) + * Called when the {credentials} have been properly set on the configuration + * object. + * + * @param err [Error] if this is set, credentials were not successfully + * loaded and this error provides information why. + * @see credentials + * @see Credentials + */ + getCredentials: function getCredentials(callback) { + var self = this; + + function finish(err) { + callback(err, err ? null : self.credentials); + } + + function credError(msg, err) { + return new AWS.util.error(err || new Error(), { + code: 'CredentialsError', + message: msg, + name: 'CredentialsError' + }); + } + + function getAsyncCredentials() { + self.credentials.get(function(err) { + if (err) { + var msg = 'Could not load credentials from ' + + self.credentials.constructor.name; + err = credError(msg, err); } - }, - 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" + finish(err); + }); + } + + function getStaticCredentials() { + var err = null; + if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { + err = credError('Missing credentials'); + } + finish(err); + } + + if (self.credentials) { + if (typeof self.credentials.get === 'function') { + getAsyncCredentials(); + } else { // static credentials + getStaticCredentials(); + } + } else if (self.credentialProvider) { + self.credentialProvider.resolve(function(err, creds) { + if (err) { + err = credError('Could not load credentials from any providers', err); } - }, - url: "/teams/:team_id/repos/:owner/:repo" + self.credentials = creds; + finish(err); + }); + } else { + finish(credError('No credentials to load')); + } + }, + + /** + * @!group Loading and Setting Configuration Options + */ + + /** + * @overload update(options, allowUnknownKeys = false) + * Updates the current configuration object with new options. + * + * @example Update maxRetries property of a configuration object + * config.update({maxRetries: 10}); + * @param [Object] options a map of option keys and values. + * @param [Boolean] allowUnknownKeys whether unknown keys can be set on + * the configuration object. Defaults to `false`. + * @see constructor + */ + update: function update(options, allowUnknownKeys) { + allowUnknownKeys = allowUnknownKeys || false; + options = this.extractCredentials(options); + AWS.util.each.call(this, options, function (key, value) { + if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || + AWS.Service.hasService(key)) { + this.set(key, value); + } + }); + }, + + /** + * Loads configuration data from a JSON file into this config object. + * @note Loading configuration will reset all existing configuration + * on the object. + * @!macro nobrowser + * @param path [String] the path relative to your process's current + * working directory to load configuration from. + * @return [AWS.Config] the same configuration object + */ + loadFromPath: function loadFromPath(path) { + this.clear(); + + var options = JSON.parse(AWS.util.readFileSync(path)); + var fileSystemCreds = new AWS.FileSystemCredentials(path); + var chain = new AWS.CredentialProviderChain(); + chain.providers.unshift(fileSystemCreds); + chain.resolve(function (err, creds) { + if (err) throw err; + else options.credentials = creds; + }); + + this.constructor(options); + + return this; + }, + + /** + * Clears configuration data on this object + * + * @api private + */ + clear: function clear() { + /*jshint forin:false */ + AWS.util.each.call(this, this.keys, function (key) { + delete this[key]; + }); + + // reset credential provider + this.set('credentials', undefined); + this.set('credentialProvider', undefined); + }, + + /** + * Sets a property on the configuration object, allowing for a + * default value + * @api private + */ + set: function set(property, value, defaultValue) { + if (value === undefined) { + if (defaultValue === undefined) { + defaultValue = this.keys[property]; + } + if (typeof defaultValue === 'function') { + this[property] = defaultValue.call(this); + } else { + this[property] = defaultValue; + } + } else if (property === 'httpOptions' && this[property]) { + // deep merge httpOptions + this[property] = AWS.util.merge(this[property], value); + } else { + this[property] = value; + } + }, + + /** + * All of the keys with their default values. + * + * @constant + * @api private + */ + keys: { + credentials: null, + credentialProvider: null, + region: null, + logger: null, + apiVersions: {}, + apiVersion: null, + endpoint: undefined, + httpOptions: { + timeout: 120000 }, - 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" - } + maxRetries: undefined, + maxRedirects: 10, + paramValidation: true, + sslEnabled: true, + s3ForcePathStyle: false, + s3BucketEndpoint: false, + s3DisableBodySigning: true, + s3UsEast1RegionalEndpoint: 'legacy', + s3UseArnRegion: undefined, + computeChecksums: true, + convertResponseTypes: true, + correctClockSkew: false, + customUserAgent: null, + dynamoDbCrc32: true, + systemClockOffset: 0, + signatureVersion: null, + signatureCache: true, + retryDelayOptions: {}, + useAccelerateEndpoint: false, + clientSideMonitoring: false, + endpointDiscoveryEnabled: undefined, + endpointCacheSize: 1000, + hostPrefixEnabled: true, + stsRegionalEndpoints: 'legacy' + }, + + /** + * Extracts accessKeyId, secretAccessKey and sessionToken + * from a configuration hash. + * + * @api private + */ + extractCredentials: function extractCredentials(options) { + if (options.accessKeyId && options.secretAccessKey) { + options = AWS.util.copy(options); + options.credentials = new AWS.Credentials(options); + } + return options; + }, + + /** + * Sets the promise dependency the SDK will use wherever Promises are returned. + * Passing `null` will force the SDK to use native Promises if they are available. + * If native Promises are not available, passing `null` will have no effect. + * @param [Constructor] dep A reference to a Promise constructor + */ + setPromisesDependency: function setPromisesDependency(dep) { + PromisesDependency = dep; + // if null was passed in, we should try to use native promises + if (dep === null && typeof Promise === 'function') { + PromisesDependency = Promise; + } + var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; + if (AWS.S3) { + constructors.push(AWS.S3); + if (AWS.S3.ManagedUpload) { + constructors.push(AWS.S3.ManagedUpload); + } + } + AWS.util.addPromises(constructors, PromisesDependency); + }, + + /** + * Gets the promise dependency set by `AWS.config.setPromisesDependency`. + */ + getPromisesDependency: function getPromisesDependency() { + return PromisesDependency; + } +}); + +/** + * @return [AWS.Config] The global configuration object singleton instance + * @readonly + * @see AWS.Config + */ +AWS.config = new AWS.Config(); + + +/***/ }), + +/***/ 5566: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +/** + * @api private + */ +function validateRegionalEndpointsFlagValue(configValue, errorOptions) { + if (typeof configValue !== 'string') return undefined; + else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { + return configValue.toLowerCase(); + } else { + throw AWS.util.error(new Error(), errorOptions); + } +} + +/** + * Resolve the configuration value for regional endpoint from difference sources: client + * config, environmental variable, shared config file. Value can be case-insensitive + * 'legacy' or 'reginal'. + * @param originalConfig user-supplied config object to resolve + * @param options a map of config property names from individual configuration source + * - env: name of environmental variable that refers to the config + * - sharedConfig: name of shared configuration file property that refers to the config + * - clientConfig: name of client configuration property that refers to the config + * + * @api private + */ +function resolveRegionalEndpointsFlag(originalConfig, options) { + originalConfig = originalConfig || {}; + //validate config value + var resolved; + if (originalConfig[options.clientConfig]) { + resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { + code: 'InvalidConfiguration', + message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + + ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' + }); + if (resolved) return resolved; + } + if (!AWS.util.isNode()) return resolved; + //validate environmental variable + if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { + var envFlag = process.env[options.env]; + resolved = validateRegionalEndpointsFlagValue(envFlag, { + code: 'InvalidEnvironmentalVariable', + message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + + ' or "regional". Got "' + process.env[options.env] + '".' + }); + if (resolved) return resolved; + } + //validate shared config file + var profile = {}; + try { + var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); + profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; + } catch (e) {}; + if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { + var fileFlag = profile[options.sharedConfig]; + resolved = validateRegionalEndpointsFlagValue(fileFlag, { + code: 'InvalidConfiguration', + message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + + ' or "regional". Got "' + profile[options.sharedConfig] + '".' + }); + if (resolved) return resolved; + } + return resolved; +} + +module.exports = resolveRegionalEndpointsFlag; + + +/***/ }), + +/***/ 8437: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * The main AWS namespace + */ +var AWS = { util: __webpack_require__(7985) }; + +/** + * @api private + * @!macro [new] nobrowser + * @note This feature is not supported in the browser environment of the SDK. + */ +var _hidden = {}; _hidden.toString(); // hack to parse macro + +/** + * @api private + */ +module.exports = AWS; + +AWS.util.update(AWS, { + + /** + * @constant + */ + VERSION: '2.752.0', + + /** + * @api private + */ + Signers: {}, + + /** + * @api private + */ + Protocol: { + Json: __webpack_require__(83), + Query: __webpack_require__(761), + Rest: __webpack_require__(8200), + RestJson: __webpack_require__(5883), + RestXml: __webpack_require__(5143) + }, + + /** + * @api private + */ + XML: { + Builder: __webpack_require__(3546), + Parser: null // conditionally set based on environment + }, + + /** + * @api private + */ + JSON: { + Builder: __webpack_require__(7495), + Parser: __webpack_require__(5474) + }, + + /** + * @api private + */ + Model: { + Api: __webpack_require__(7657), + Operation: __webpack_require__(8083), + Shape: __webpack_require__(1349), + Paginator: __webpack_require__(5938), + ResourceWaiter: __webpack_require__(1368) + }, + + /** + * @api private + */ + apiLoader: __webpack_require__(2793), + + /** + * @api private + */ + EndpointCache: __webpack_require__(6323)/* .EndpointCache */ .$ +}); +__webpack_require__(5948); +__webpack_require__(8903); +__webpack_require__(8110); +__webpack_require__(1556); +__webpack_require__(4995); +__webpack_require__(8652); +__webpack_require__(8743); +__webpack_require__(7246); +__webpack_require__(9897); +__webpack_require__(9127); + +/** + * @readonly + * @return [AWS.SequentialExecutor] a collection of global event listeners that + * are attached to every sent request. + * @see AWS.Request AWS.Request for a list of events to listen for + * @example Logging the time taken to send a request + * AWS.events.on('send', function startSend(resp) { + * resp.startTime = new Date().getTime(); + * }).on('complete', function calculateTime(resp) { + * var time = (new Date().getTime() - resp.startTime) / 1000; + * console.log('Request took ' + time + ' seconds'); + * }); + * + * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds' + */ +AWS.events = new AWS.SequentialExecutor(); + +//create endpoint cache lazily +AWS.util.memoizedProperty(AWS, 'endpointCache', function() { + return new AWS.EndpointCache(AWS.config.endpointCacheSize); +}, true); + + +/***/ }), + +/***/ 3819: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); + +/** + * Represents your AWS security credentials, specifically the + * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}. + * Creating a `Credentials` object allows you to pass around your + * security information to configuration and service objects. + * + * Note that this class typically does not need to be constructed manually, + * as the {AWS.Config} and {AWS.Service} classes both accept simple + * options hashes with the three keys. These structures will be converted + * into Credentials objects automatically. + * + * ## Expiring and Refreshing Credentials + * + * Occasionally credentials can expire in the middle of a long-running + * application. In this case, the SDK will automatically attempt to + * refresh the credentials from the storage location if the Credentials + * class implements the {refresh} method. + * + * If you are implementing a credential storage location, you + * will want to create a subclass of the `Credentials` class and + * override the {refresh} method. This method allows credentials to be + * retrieved from the backing store, be it a file system, database, or + * some network storage. The method should reset the credential attributes + * on the object. + * + * @!attribute expired + * @return [Boolean] whether the credentials have been expired and + * require a refresh. Used in conjunction with {expireTime}. + * @!attribute expireTime + * @return [Date] a time when credentials should be considered expired. Used + * in conjunction with {expired}. + * @!attribute accessKeyId + * @return [String] the AWS access key ID + * @!attribute secretAccessKey + * @return [String] the AWS secret access key + * @!attribute sessionToken + * @return [String] an optional AWS session token + */ +AWS.Credentials = AWS.util.inherit({ + /** + * A credentials object can be created using positional arguments or an options + * hash. + * + * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null) + * Creates a Credentials object with a given set of credential information + * as positional arguments. + * @param accessKeyId [String] the AWS access key ID + * @param secretAccessKey [String] the AWS secret access key + * @param sessionToken [String] the optional AWS session token + * @example Create a credentials object with AWS credentials + * var creds = new AWS.Credentials('akid', 'secret', 'session'); + * @overload AWS.Credentials(options) + * Creates a Credentials object with a given set of credential information + * as an options hash. + * @option options accessKeyId [String] the AWS access key ID + * @option options secretAccessKey [String] the AWS secret access key + * @option options sessionToken [String] the optional AWS session token + * @example Create a credentials object with AWS credentials + * var creds = new AWS.Credentials({ + * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session' + * }); + */ + constructor: function Credentials() { + // hide secretAccessKey from being displayed with util.inspect + AWS.util.hideProperties(this, ['secretAccessKey']); + + this.expired = false; + this.expireTime = null; + this.refreshCallbacks = []; + if (arguments.length === 1 && typeof arguments[0] === 'object') { + var creds = arguments[0].credentials || arguments[0]; + this.accessKeyId = creds.accessKeyId; + this.secretAccessKey = creds.secretAccessKey; + this.sessionToken = creds.sessionToken; + } else { + this.accessKeyId = arguments[0]; + this.secretAccessKey = arguments[1]; + this.sessionToken = arguments[2]; + } + }, + + /** + * @return [Integer] the number of seconds before {expireTime} during which + * the credentials will be considered expired. + */ + expiryWindow: 15, + + /** + * @return [Boolean] whether the credentials object should call {refresh} + * @note Subclasses should override this method to provide custom refresh + * logic. + */ + needsRefresh: function needsRefresh() { + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + + if (this.expireTime && adjustedTime > this.expireTime) { + return true; + } else { + return this.expired || !this.accessKeyId || !this.secretAccessKey; + } + }, + + /** + * Gets the existing credentials, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload credentials when they are already + * loaded into the object. + * + * @callback callback function(err) + * When this callback is called with no error, it means either credentials + * do not need to be refreshed or refreshed credentials information has + * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + */ + get: function get(callback) { + var self = this; + if (this.needsRefresh()) { + this.refresh(function(err) { + if (!err) self.expired = false; // reset expired flag + if (callback) callback(err); + }); + } else if (callback) { + callback(); + } + }, + + /** + * @!method getPromise() + * Returns a 'thenable' promise. + * Gets the existing credentials, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload credentials when they are already + * loaded into the object. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means either credentials do not need to be refreshed or refreshed + * credentials information has been loaded into the object (as the + * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled + * @return [Promise] A promise that represents the state of the `get` call. + * @example Calling the `getPromise` method. + * var promise = credProvider.getPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ + + /** + * @!method refreshPromise() + * Returns a 'thenable' promise. + * Refreshes the credentials. Users should call {get} before attempting + * to forcibly refresh credentials. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means refreshed credentials information has been loaded into the object + * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled + * @return [Promise] A promise that represents the state of the `refresh` call. + * @example Calling the `refreshPromise` method. + * var promise = credProvider.refreshPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ + + /** + * Refreshes the credentials. Users should call {get} before attempting + * to forcibly refresh credentials. + * + * @callback callback function(err) + * When this callback is called with no error, it means refreshed + * credentials information has been loaded into the object (as the + * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @note Subclasses should override this class to reset the + * {accessKeyId}, {secretAccessKey} and optional {sessionToken} + * on the credentials object and then call the callback with + * any error information. + * @see get + */ + refresh: function refresh(callback) { + this.expired = false; + callback(); + }, + + /** + * @api private + * @param callback + */ + coalesceRefresh: function coalesceRefresh(callback, sync) { + var self = this; + if (self.refreshCallbacks.push(callback) === 1) { + self.load(function onLoad(err) { + AWS.util.arrayEach(self.refreshCallbacks, function(callback) { + if (sync) { + callback(err); + } else { + // callback could throw, so defer to ensure all callbacks are notified + AWS.util.defer(function () { + callback(err); + }); + } + }); + self.refreshCallbacks.length = 0; + }); + } + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + callback(); + } +}); + +/** + * @api private + */ +AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); + this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); +}; + +/** + * @api private + */ +AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.getPromise; + delete this.prototype.refreshPromise; +}; + +AWS.util.addPromises(AWS.Credentials); + + +/***/ }), + +/***/ 7083: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var STS = __webpack_require__(7513); + +/** + * Represents temporary credentials retrieved from {AWS.STS}. Without any + * extra parameters, credentials will be fetched from the + * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the + * {AWS.STS.assumeRole} operation will be used to fetch credentials for the + * role instead. + * + * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in + * the way masterCredentials and refreshes are handled. + * AWS.ChainableTemporaryCredentials refreshes expired credentials using the + * masterCredentials passed by the user to support chaining of STS credentials. + * However, AWS.TemporaryCredentials recursively collapses the masterCredentials + * during instantiation, precluding the ability to refresh credentials which + * require intermediate, temporary credentials. + * + * For example, if the application should use RoleA, which must be assumed from + * RoleB, and the environment provides credentials which can assume RoleB, then + * AWS.ChainableTemporaryCredentials must be used to support refreshing the + * temporary credentials for RoleA: + * + * ```javascript + * var roleACreds = new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: 'RoleA'}, + * masterCredentials: new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: 'RoleB'}, + * masterCredentials: new AWS.EnvironmentCredentials('AWS') + * }) + * }); + * ``` + * + * If AWS.TemporaryCredentials had been used in the previous example, + * `roleACreds` would fail to refresh because `roleACreds` would + * use the environment credentials for the AssumeRole request. + * + * Another difference is that AWS.ChainableTemporaryCredentials creates the STS + * service instance during instantiation while AWS.TemporaryCredentials creates + * the STS service instance during the first refresh. Creating the service + * instance during instantiation effectively captures the master credentials + * from the global config, so that subsequent changes to the global config do + * not affect the master credentials used to refresh the temporary credentials. + * + * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned + * to AWS.config.credentials: + * + * ```javascript + * var envCreds = new AWS.EnvironmentCredentials('AWS'); + * AWS.config.credentials = envCreds; + * // masterCredentials will be envCreds + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: '...'} + * }); + * ``` + * + * Similarly, to use the CredentialProviderChain's default providers as the + * master credentials, simply create a new instance of + * AWS.ChainableTemporaryCredentials: + * + * ```javascript + * AWS.config.credentials = new ChainableTemporaryCredentials({ + * params: {RoleArn: '...'} + * }); + * ``` + * + * @!attribute service + * @return [AWS.STS] the STS service instance used to + * get and refresh temporary credentials from AWS STS. + * @note (see constructor) + */ +AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new temporary credentials object. + * + * @param options [map] a set of options + * @option options params [map] ({}) a map of options that are passed to the + * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. + * If a `RoleArn` parameter is passed in, credentials will be based on the + * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must + * also be passed in or an error will be thrown. + * @option options masterCredentials [AWS.Credentials] the master credentials + * used to get and refresh temporary credentials from AWS STS. By default, + * AWS.config.credentials or AWS.config.credentialProvider will be used. + * @option options tokenCodeFn [Function] (null) Function to provide + * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function + * is called with value of `SerialNumber` and `callback`, and should provide + * the `TokenCode` or an error to the callback in the format + * `callback(err, token)`. + * @example Creating a new credentials object for generic temporary credentials + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials(); + * @example Creating a new credentials object for an IAM role + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ + * params: { + * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials' + * } + * }); + * @see AWS.STS.assumeRole + * @see AWS.STS.getSessionToken + */ + constructor: function ChainableTemporaryCredentials(options) { + AWS.Credentials.call(this); + options = options || {}; + this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; + this.expired = true; + this.tokenCodeFn = null; + + var params = AWS.util.copy(options.params) || {}; + if (params.RoleArn) { + params.RoleSessionName = params.RoleSessionName || 'temporary-credentials'; + } + if (params.SerialNumber) { + if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) { + throw new AWS.util.error( + new Error('tokenCodeFn must be a function when params.SerialNumber is given'), + {code: this.errorCode} + ); + } else { + this.tokenCodeFn = options.tokenCodeFn; + } + } + var config = AWS.util.merge( + { + params: params, + credentials: options.masterCredentials || AWS.config.credentials }, - 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" + options.stsConfig || {} + ); + this.service = new STS(config); + }, + + /** + * Refreshes credentials using {AWS.STS.assumeRole} or + * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed + * to the credentials {constructor}. + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see AWS.Credentials.get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + var self = this; + var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken'; + this.getTokenCode(function (err, tokenCode) { + var params = {}; + if (err) { + callback(err); + return; + } + if (tokenCode) { + params.TokenCode = tokenCode; + } + self.service[operation](params, function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); } - }, - 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" + callback(err); + }); + }); + }, + + /** + * @api private + */ + getTokenCode: function getTokenCode(callback) { + var self = this; + if (this.tokenCodeFn) { + this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) { + if (err) { + var message = err; + if (err instanceof Error) { + message = err.message; + } + callback( + AWS.util.error( + new Error('Error fetching MFA token: ' + message), + { code: self.errorCode} + ) + ); + return; } + callback(null, token); + }); + } else { + callback(null); + } + } +}); + + +/***/ }), + +/***/ 3498: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var CognitoIdentity = __webpack_require__(8291); +var STS = __webpack_require__(7513); + +/** + * Represents credentials retrieved from STS Web Identity Federation using + * the Amazon Cognito Identity service. + * + * By default this provider gets credentials using the + * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which + * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito + * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to + * obtain an `IdentityId`. If the identity or identity pool is not configured in + * the Amazon Cognito Console to use IAM roles with the appropriate permissions, + * then additionally a `RoleArn` is required containing the ARN of the IAM trust + * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` + * is provided, then this provider gets credentials using the + * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an + * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. + * + * In addition, if this credential provider is used to provide authenticated + * login, the `Logins` map may be set to the tokens provided by the respective + * identity providers. See {constructor} for an example on creating a credentials + * object with proper property values. + * + * ## Refreshing Credentials from Identity Service + * + * In addition to AWS credentials expiring after a given amount of time, the + * login token from the identity provider will also expire. Once this token + * expires, it will not be usable to refresh AWS credentials, and another + * token will be needed. The SDK does not manage refreshing of the token value, + * but this can be done through a "refresh token" supported by most identity + * providers. Consult the documentation for the identity provider for refreshing + * tokens. Once the refreshed token is acquired, you should make sure to update + * this new token in the credentials object's {params} property. The following + * code will update the WebIdentityToken, assuming you have retrieved an updated + * token from the identity provider: + * + * ```javascript + * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; + * ``` + * + * Future calls to `credentials.refresh()` will now use the new token. + * + * @!attribute params + * @return [map] the map of params passed to + * {AWS.CognitoIdentity.getId}, + * {AWS.CognitoIdentity.getOpenIdToken}, and + * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the + * `params.WebIdentityToken` property. + * @!attribute data + * @return [map] the raw data response from the call to + * {AWS.CognitoIdentity.getCredentialsForIdentity}, or + * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get + * access to other properties from the response. + * @!attribute identityId + * @return [String] the Cognito ID returned by the last call to + * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual + * final resolved identity ID from Amazon Cognito. + */ +AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * @api private + */ + localStorageKey: { + id: 'aws.cognito.identity-id.', + providers: 'aws.cognito.identity-providers.' + }, + + /** + * Creates a new credentials object. + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ + * + * // either IdentityPoolId or IdentityId is required + * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) + * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity + * // or AWS.CognitoIdentity.getOpenIdToken (linked below) + * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', + * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' + * + * // optional, only necessary when the identity pool is not configured + * // to use IAM roles in the Amazon Cognito Console + * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) + * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', + * + * // optional tokens, used for authenticated login + * // See the Logins param for AWS.CognitoIdentity.getID (linked below) + * Logins: { + * 'graph.facebook.com': 'FBTOKEN', + * 'www.amazon.com': 'AMAZONTOKEN', + * 'accounts.google.com': 'GOOGLETOKEN', + * 'api.twitter.com': 'TWITTERTOKEN', + * 'www.digits.com': 'DIGITSTOKEN' + * }, + * + * // optional name, defaults to web-identity + * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) + * RoleSessionName: 'web', + * + * // optional, only necessary when application runs in a browser + * // and multiple users are signed in at once, used for caching + * LoginId: 'example@gmail.com' + * + * }, { + * // optionally provide configuration to apply to the underlying service clients + * // if configuration is not provided, then configuration will be pulled from AWS.config + * + * // region should match the region your identity pool is located in + * region: 'us-east-1', + * + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } + * }); + * @see AWS.CognitoIdentity.getId + * @see AWS.CognitoIdentity.getCredentialsForIdentity + * @see AWS.STS.assumeRoleWithWebIdentity + * @see AWS.CognitoIdentity.getOpenIdToken + * @see AWS.Config + * @note If a region is not provided in the global AWS.config, or + * specified in the `clientConfig` to the CognitoIdentityCredentials + * constructor, you may encounter a 'Missing credentials in config' error + * when calling making a service call. + */ + constructor: function CognitoIdentityCredentials(params, clientConfig) { + AWS.Credentials.call(this); + this.expired = true; + this.params = params; + this.data = null; + this._identityId = null; + this._clientConfig = AWS.util.copy(clientConfig || {}); + this.loadCachedId(); + var self = this; + Object.defineProperty(this, 'identityId', { + get: function() { + self.loadCachedId(); + return self._identityId || self.params.IdentityId; }, - 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" + set: function(identityId) { + self._identityId = identityId; + } + }); + }, + + /** + * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, + * or {AWS.STS.assumeRoleWithWebIdentity}. + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see AWS.Credentials.get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.data = null; + self._identityId = null; + self.getId(function(err) { + if (!err) { + if (!self.params.RoleArn) { + self.getCredentialsForIdentity(callback); + } else { + self.getCredentialsFromSTS(callback); } - }, - 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" + } else { + self.clearIdOnNotAuthorized(err); + callback(err); + } + }); + }, + + /** + * Clears the cached Cognito ID associated with the currently configured + * identity pool ID. Use this to manually invalidate your cache if + * the identity pool ID was deleted. + */ + clearCachedId: function clearCache() { + this._identityId = null; + delete this.params.IdentityId; + + var poolId = this.params.IdentityPoolId; + var loginId = this.params.LoginId || ''; + delete this.storage[this.localStorageKey.id + poolId + loginId]; + delete this.storage[this.localStorageKey.providers + poolId + loginId]; + }, + + /** + * @api private + */ + clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { + var self = this; + if (err.code == 'NotAuthorizedException') { + self.clearCachedId(); + } + }, + + /** + * Retrieves a Cognito ID, loading from cache if it was already retrieved + * on this device. + * + * @callback callback function(err, identityId) + * @param err [Error, null] an error object if the call failed or null if + * it succeeded. + * @param identityId [String, null] if successful, the callback will return + * the Cognito ID. + * @note If not loaded explicitly, the Cognito ID is loaded and stored in + * localStorage in the browser environment of a device. + * @api private + */ + getId: function getId(callback) { + var self = this; + if (typeof self.params.IdentityId === 'string') { + return callback(null, self.params.IdentityId); + } + + self.cognito.getId(function(err, data) { + if (!err && data.IdentityId) { + self.params.IdentityId = data.IdentityId; + callback(null, data.IdentityId); + } else { + callback(err); + } + }); + }, + + + /** + * @api private + */ + loadCredentials: function loadCredentials(data, credentials) { + if (!data || !credentials) return; + credentials.expired = false; + credentials.accessKeyId = data.Credentials.AccessKeyId; + credentials.secretAccessKey = data.Credentials.SecretKey; + credentials.sessionToken = data.Credentials.SessionToken; + credentials.expireTime = data.Credentials.Expiration; + }, + + /** + * @api private + */ + getCredentialsForIdentity: function getCredentialsForIdentity(callback) { + var self = this; + self.cognito.getCredentialsForIdentity(function(err, data) { + if (!err) { + self.cacheId(data); + self.data = data; + self.loadCredentials(self.data, self); + } else { + self.clearIdOnNotAuthorized(err); + } + callback(err); + }); + }, + + /** + * @api private + */ + getCredentialsFromSTS: function getCredentialsFromSTS(callback) { + var self = this; + self.cognito.getOpenIdToken(function(err, data) { + if (!err) { + self.cacheId(data); + self.params.WebIdentityToken = data.Token; + self.webIdentityCredentials.refresh(function(webErr) { + if (!webErr) { + self.data = self.webIdentityCredentials.data; + self.sts.credentialsFrom(self.data, self); + } + callback(webErr); + }); + } else { + self.clearIdOnNotAuthorized(err); + callback(err); + } + }); + }, + + /** + * @api private + */ + loadCachedId: function loadCachedId() { + var self = this; + + // in the browser we source default IdentityId from localStorage + if (AWS.util.isBrowser() && !self.params.IdentityId) { + var id = self.getStorage('id'); + if (id && self.params.Logins) { + var actualProviders = Object.keys(self.params.Logins); + var cachedProviders = + (self.getStorage('providers') || '').split(','); + + // only load ID if at least one provider used this ID before + var intersect = cachedProviders.filter(function(n) { + return actualProviders.indexOf(n) !== -1; + }); + if (intersect.length !== 0) { + self.params.IdentityId = id; } - }, - 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" + } else if (id) { + self.params.IdentityId = id; + } + } + }, + + /** + * @api private + */ + createClients: function() { + var clientConfig = this._clientConfig; + this.webIdentityCredentials = this.webIdentityCredentials || + new AWS.WebIdentityCredentials(this.params, clientConfig); + if (!this.cognito) { + var cognitoConfig = AWS.util.merge({}, clientConfig); + cognitoConfig.params = this.params; + this.cognito = new CognitoIdentity(cognitoConfig); + } + this.sts = this.sts || new STS(clientConfig); + }, + + /** + * @api private + */ + cacheId: function cacheId(data) { + this._identityId = data.IdentityId; + this.params.IdentityId = this._identityId; + + // cache this IdentityId in browser localStorage if possible + if (AWS.util.isBrowser()) { + this.setStorage('id', data.IdentityId); + + if (this.params.Logins) { + this.setStorage('providers', Object.keys(this.params.Logins).join(',')); + } + } + }, + + /** + * @api private + */ + getStorage: function getStorage(key) { + return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; + }, + + /** + * @api private + */ + setStorage: function setStorage(key, val) { + try { + this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; + } catch (_) {} + }, + + /** + * @api private + */ + storage: (function() { + try { + var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? + window.localStorage : {}; + + // Test set/remove which would throw an error in Safari's private browsing + storage['aws.test-storage'] = 'foobar'; + delete storage['aws.test-storage']; + + return storage; + } catch (_) { + return {}; + } + })() +}); + + +/***/ }), + +/***/ 6965: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); + +/** + * Creates a credential provider chain that searches for AWS credentials + * in a list of credential providers specified by the {providers} property. + * + * By default, the chain will use the {defaultProviders} to resolve credentials. + * These providers will look in the environment using the + * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes. + * + * ## Setting Providers + * + * Each provider in the {providers} list should be a function that returns + * a {AWS.Credentials} object, or a hardcoded credentials object. The function + * form allows for delayed execution of the credential construction. + * + * ## Resolving Credentials from a Chain + * + * Call {resolve} to return the first valid credential object that can be + * loaded by the provider chain. + * + * For example, to resolve a chain with a custom provider that checks a file + * on disk after the set of {defaultProviders}: + * + * ```javascript + * var diskProvider = new AWS.FileSystemCredentials('./creds.json'); + * var chain = new AWS.CredentialProviderChain(); + * chain.providers.push(diskProvider); + * chain.resolve(); + * ``` + * + * The above code will return the `diskProvider` object if the + * file contains credentials and the `defaultProviders` do not contain + * any credential settings. + * + * @!attribute providers + * @return [Array] + * a list of credentials objects or functions that return credentials + * objects. If the provider is a function, the function will be + * executed lazily when the provider needs to be checked for valid + * credentials. By default, this object will be set to the + * {defaultProviders}. + * @see defaultProviders + */ +AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { + + /** + * Creates a new CredentialProviderChain with a default set of providers + * specified by {defaultProviders}. + */ + constructor: function CredentialProviderChain(providers) { + if (providers) { + this.providers = providers; + } else { + this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0); + } + this.resolveCallbacks = []; + }, + + /** + * @!method resolvePromise() + * Returns a 'thenable' promise. + * Resolves the provider chain by searching for the first set of + * credentials in {providers}. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(credentials) + * Called if the promise is fulfilled and the provider resolves the chain + * to a credentials object + * @param credentials [AWS.Credentials] the credentials object resolved + * by the provider chain. + * @callback rejectedCallback function(error) + * Called if the promise is rejected. + * @param err [Error] the error object returned if no credentials are found. + * @return [Promise] A promise that represents the state of the `resolve` method call. + * @example Calling the `resolvePromise` method. + * var promise = chain.resolvePromise(); + * promise.then(function(credentials) { ... }, function(err) { ... }); + */ + + /** + * Resolves the provider chain by searching for the first set of + * credentials in {providers}. + * + * @callback callback function(err, credentials) + * Called when the provider resolves the chain to a credentials object + * or null if no credentials can be found. + * + * @param err [Error] the error object returned if no credentials are + * found. + * @param credentials [AWS.Credentials] the credentials object resolved + * by the provider chain. + * @return [AWS.CredentialProviderChain] the provider, for chaining. + */ + resolve: function resolve(callback) { + var self = this; + if (self.providers.length === 0) { + callback(new Error('No providers')); + return self; + } + + if (self.resolveCallbacks.push(callback) === 1) { + var index = 0; + var providers = self.providers.slice(0); + + function resolveNext(err, creds) { + if ((!err && creds) || index === providers.length) { + AWS.util.arrayEach(self.resolveCallbacks, function (callback) { + callback(err, creds); + }); + self.resolveCallbacks.length = 0; + return; } - }, - 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" + + var provider = providers[index++]; + if (typeof provider === 'function') { + creds = provider.call(); + } else { + creds = provider; } - }, - 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 (creds.get) { + creds.get(function (getErr) { + resolveNext(getErr, getErr ? null : creds); + }); + } else { + resolveNext(null, creds); } - }, - 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" + } + + resolveNext(); + } + + return self; + } +}); + +/** + * The default set of providers used by a vanilla CredentialProviderChain. + * + * In the browser: + * + * ```javascript + * AWS.CredentialProviderChain.defaultProviders = [] + * ``` + * + * In Node.js: + * + * ```javascript + * AWS.CredentialProviderChain.defaultProviders = [ + * function () { return new AWS.EnvironmentCredentials('AWS'); }, + * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + * function () { return new AWS.SharedIniFileCredentials(); }, + * function () { return new AWS.ECSCredentials(); }, + * function () { return new AWS.ProcessCredentials(); }, + * function () { return new AWS.TokenFileWebIdentityCredentials(); }, + * function () { return new AWS.EC2MetadataCredentials() } + * ] + * ``` + */ +AWS.CredentialProviderChain.defaultProviders = []; + +/** + * @api private + */ +AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); +}; + +/** + * @api private + */ +AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.resolvePromise; +}; + +AWS.util.addPromises(AWS.CredentialProviderChain); + + +/***/ }), + +/***/ 3379: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +__webpack_require__(5768); + +/** + * Represents credentials received from the metadata service on an EC2 instance. + * + * By default, this class will connect to the metadata service using + * {AWS.MetadataService} and attempt to load any available credentials. If it + * can connect, and credentials are available, these will be used with zero + * configuration. + * + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the EC2 metadata service are timing out, you can increase + * these values by configuring them directly: + * + * ```javascript + * AWS.config.credentials = new AWS.EC2MetadataCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 } // see AWS.Config for information + * }); + * + * If your requests are timing out in connecting to the metadata service, such + * as when testing on a development machine, you can use the connectTimeout + * option, specified in milliseconds, which also defaults to 1 second. + * ``` + * + * @see AWS.Config.retryDelayOptions + * + * @!macro nobrowser + */ +AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { + constructor: function EC2MetadataCredentials(options) { + AWS.Credentials.call(this); + + options = options ? AWS.util.copy(options) : {}; + options = AWS.util.merge( + {maxRetries: this.defaultMaxRetries}, options); + if (!options.httpOptions) options.httpOptions = {}; + options.httpOptions = AWS.util.merge( + {timeout: this.defaultTimeout, + connectTimeout: this.defaultConnectTimeout}, + options.httpOptions); + + this.metadataService = new AWS.MetadataService(options); + this.metadata = {}; + }, + + /** + * @api private + */ + defaultTimeout: 1000, + + /** + * @api private + */ + defaultConnectTimeout: 1000, + + /** + * @api private + */ + defaultMaxRetries: 3, + + /** + * Loads the credentials from the instance metadata service + * + * @callback callback function(err) + * Called when the instance metadata service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + var self = this; + self.metadataService.loadCredentials(function(err, creds) { + if (!err) { + var currentTime = AWS.util.date.getDate(); + var expireTime = new Date(creds.Expiration); + if (expireTime < currentTime) { + err = AWS.util.error( + new Error('EC2 Instance Metadata Serivce provided expired credentials'), + { code: 'EC2MetadataCredentialsProviderFailure' } + ); + } else { + self.expired = false; + self.metadata = creds; + self.accessKeyId = creds.AccessKeyId; + self.secretAccessKey = creds.SecretAccessKey; + self.sessionToken = creds.Token; + self.expireTime = expireTime; } - }, - 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" + } + callback(err); + }); + } +}); + + +/***/ }), + +/***/ 645: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); + +/** + * Represents credentials received from relative URI specified in the ECS container. + * + * This class will request refreshable credentials from the relative URI + * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the + * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials + * are returned in the response, these will be used with zero configuration. + * + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the relative URI are timing out, you can increase + * the value by configuring them directly: + * + * ```javascript + * AWS.config.credentials = new AWS.ECSCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 } // see AWS.Config for information + * }); + * ``` + * + * @see AWS.Config.retryDelayOptions + * + * @!macro nobrowser + */ +AWS.ECSCredentials = AWS.RemoteCredentials; + + +/***/ }), + +/***/ 7714: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); + +/** + * Represents credentials from the environment. + * + * By default, this class will look for the matching environment variables + * prefixed by a given {envPrefix}. The un-prefixed environment variable names + * for each credential value is listed below: + * + * ```javascript + * accessKeyId: ACCESS_KEY_ID + * secretAccessKey: SECRET_ACCESS_KEY + * sessionToken: SESSION_TOKEN + * ``` + * + * With the default prefix of 'AWS', the environment variables would be: + * + * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN + * + * @!attribute envPrefix + * @readonly + * @return [String] the prefix for the environment variable names excluding + * the separating underscore ('_'). + */ +AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, { + + /** + * Creates a new EnvironmentCredentials class with a given variable + * prefix {envPrefix}. For example, to load credentials using the 'AWS' + * prefix: + * + * ```javascript + * var creds = new AWS.EnvironmentCredentials('AWS'); + * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var + * ``` + * + * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment + * variables. Do not include the separating underscore. + */ + constructor: function EnvironmentCredentials(envPrefix) { + AWS.Credentials.call(this); + this.envPrefix = envPrefix; + this.get(function() {}); + }, + + /** + * Loads credentials from the environment using the prefixed + * environment variables. + * + * @callback callback function(err) + * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and + * SESSION_TOKEN environment variables are read. When this callback is + * called with no error, it means that the credentials information has + * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + if (!callback) callback = AWS.util.fn.callback; + + if (!process || !process.env) { + callback(AWS.util.error( + new Error('No process info or environment variables available'), + { code: 'EnvironmentCredentialsProviderFailure' } + )); + return; + } + + var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN']; + var values = []; + + for (var i = 0; i < keys.length; i++) { + var prefix = ''; + if (this.envPrefix) prefix = this.envPrefix + '_'; + values[i] = process.env[prefix + keys[i]]; + if (!values[i] && keys[i] !== 'SESSION_TOKEN') { + callback(AWS.util.error( + new Error('Variable ' + prefix + keys[i] + ' not set.'), + { code: 'EnvironmentCredentialsProviderFailure' } + )); + return; + } + } + + this.expired = false; + AWS.Credentials.apply(this, values); + callback(); + } + +}); + + +/***/ }), + +/***/ 7454: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); + +/** + * Represents credentials from a JSON file on disk. + * If the credentials expire, the SDK can {refresh} the credentials + * from the file. + * + * The format of the file should be similar to the options passed to + * {AWS.Config}: + * + * ```javascript + * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'} + * ``` + * + * @example Loading credentials from disk + * var creds = new AWS.FileSystemCredentials('./configuration.json'); + * creds.accessKeyId == 'AKID' + * + * @!attribute filename + * @readonly + * @return [String] the path to the JSON file on disk containing the + * credentials. + * @!macro nobrowser + */ +AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, { + + /** + * @overload AWS.FileSystemCredentials(filename) + * Creates a new FileSystemCredentials object from a filename + * + * @param filename [String] the path on disk to the JSON file to load. + */ + constructor: function FileSystemCredentials(filename) { + AWS.Credentials.call(this); + this.filename = filename; + this.get(function() {}); + }, + + /** + * Loads the credentials from the {filename} on disk. + * + * @callback callback function(err) + * Called after the JSON file on disk is read and parsed. When this callback + * is called with no error, it means that the credentials information + * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + if (!callback) callback = AWS.util.fn.callback; + try { + var creds = JSON.parse(AWS.util.readFileSync(this.filename)); + AWS.Credentials.call(this, creds); + if (!this.accessKeyId || !this.secretAccessKey) { + throw AWS.util.error( + new Error('Credentials not set in ' + this.filename), + { code: 'FileSystemCredentialsProviderFailure' } + ); + } + this.expired = false; + callback(); + } catch (err) { + callback(err); + } + } + +}); + + +/***/ }), + +/***/ 371: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var proc = __webpack_require__(3129); +var iniLoader = AWS.util.iniLoader; + +/** + * Represents credentials loaded from shared credentials file + * (defaulting to ~/.aws/credentials or defined by the + * `AWS_SHARED_CREDENTIALS_FILE` environment variable). + * + * ## Using process credentials + * + * The credentials file can specify a credential provider that executes + * a given process and attempts to read its stdout to recieve a JSON payload + * containing the credentials: + * + * [default] + * credential_process = /usr/bin/credential_proc + * + * Automatically handles refreshing credentials if an Expiration time is + * provided in the credentials payload. Credentials supplied in the same profile + * will take precedence over the credential_process. + * + * Sourcing credentials from an external process can potentially be dangerous, + * so proceed with caution. Other credential providers should be preferred if + * at all possible. If using this option, you should make sure that the shared + * credentials file is as locked down as possible using security best practices + * for your operating system. + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.ProcessCredentials provider: + * + * ```javascript + * var creds = new AWS.ProcessCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser + */ +AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new ProcessCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + */ + constructor: function ProcessCredentials(options) { + AWS.Credentials.call(this); + + options = options || {}; + + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.get(options.callback || AWS.util.fn.noop); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; + + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: 'ProcessCredentialsProviderFailure' } + ); + } + + if (profile['credential_process']) { + this.loadViaCredentialProcess(profile, function(err, data) { + if (err) { + callback(err, null); + } else { + self.expired = false; + self.accessKeyId = data.AccessKeyId; + self.secretAccessKey = data.SecretAccessKey; + self.sessionToken = data.SessionToken; + if (data.Expiration) { + self.expireTime = new Date(data.Expiration); + } + callback(null); + } + }); + } else { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' did not include credential process'), + { code: 'ProcessCredentialsProviderFailure' } + ); + } + } catch (err) { + callback(err); + } + }, + + /** + * Executes the credential_process and retrieves + * credentials from the output + * @api private + * @param profile [map] credentials profile + * @throws ProcessCredentialsProviderFailure + */ + loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) { + proc.exec(profile['credential_process'], function(err, stdOut, stdErr) { + if (err) { + callback(AWS.util.error( + new Error('credential_process returned error'), + { code: 'ProcessCredentialsProviderFailure'} + ), null); + } else { + try { + var credData = JSON.parse(stdOut); + if (credData.Expiration) { + var currentTime = AWS.util.date.getDate(); + var expireTime = new Date(credData.Expiration); + if (expireTime < currentTime) { + throw Error('credential_process returned expired credentials'); + } + } + + if (credData.Version !== 1) { + throw Error('credential_process does not return Version == 1'); + } + callback(null, credData); + } catch (err) { + callback(AWS.util.error( + new Error(err.message), + { code: 'ProcessCredentialsProviderFailure'} + ), null); } - }, - 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" + } + }); + }, + + /** + * Loads the credentials from the credential process + * + * @callback callback function(err) + * Called after the credential process has been executed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); + } +}); + + +/***/ }), + +/***/ 8764: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437), + ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI', + ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI', + ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN', + FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'], + FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'], + FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'], + RELATIVE_URI_HOST = '169.254.170.2'; + +/** + * Represents credentials received from specified URI. + * + * This class will request refreshable credentials from the relative URI + * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the + * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials + * are returned in the response, these will be used with zero configuration. + * + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the relative URI are timing out, you can increase + * the value by configuring them directly: + * + * ```javascript + * AWS.config.credentials = new AWS.RemoteCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 } // see AWS.Config for information + * }); + * ``` + * + * @see AWS.Config.retryDelayOptions + * + * @!macro nobrowser + */ +AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, { + constructor: function RemoteCredentials(options) { + AWS.Credentials.call(this); + options = options ? AWS.util.copy(options) : {}; + if (!options.httpOptions) options.httpOptions = {}; + options.httpOptions = AWS.util.merge( + this.httpOptions, options.httpOptions); + AWS.util.update(this, options); + }, + + /** + * @api private + */ + httpOptions: { timeout: 1000 }, + + /** + * @api private + */ + maxRetries: 3, + + /** + * @api private + */ + isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() { + return Boolean( + process && + process.env && + (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI]) + ); + }, + + /** + * @api private + */ + getECSFullUri: function getECSFullUri() { + if (process && process.env) { + var relative = process.env[ENV_RELATIVE_URI], + full = process.env[ENV_FULL_URI]; + if (relative) { + return 'http://' + RELATIVE_URI_HOST + relative; + } else if (full) { + var parsed = AWS.util.urlParse(full); + if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) { + throw AWS.util.error( + new Error('Unsupported protocol: AWS.RemoteCredentials supports ' + + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; ' + + parsed.protocol + ' requested.'), + { code: 'ECSCredentialsProviderFailure' } + ); } - }, - 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" + + if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 && + FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) { + throw AWS.util.error( + new Error('Unsupported hostname: AWS.RemoteCredentials only supports ' + + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; ' + + parsed.protocol + '//' + parsed.hostname + ' requested.'), + { code: 'ECSCredentialsProviderFailure' } + ); } - }, - 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" + + return full; + } else { + throw AWS.util.error( + new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI + + ' must be set to use AWS.RemoteCredentials.'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + } else { + throw AWS.util.error( + new Error('No process info available'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + }, + + /** + * @api private + */ + getECSAuthToken: function getECSAuthToken() { + if (process && process.env && process.env[ENV_FULL_URI]) { + return process.env[ENV_AUTH_TOKEN]; + } + }, + + /** + * @api private + */ + credsFormatIsValid: function credsFormatIsValid(credData) { + return (!!credData.accessKeyId && !!credData.secretAccessKey && + !!credData.sessionToken && !!credData.expireTime); + }, + + /** + * @api private + */ + formatCreds: function formatCreds(credData) { + if (!!credData.credentials) { + credData = credData.credentials; + } + + return { + expired: false, + accessKeyId: credData.accessKeyId || credData.AccessKeyId, + secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey, + sessionToken: credData.sessionToken || credData.Token, + expireTime: new Date(credData.expiration || credData.Expiration) + }; + }, + + /** + * @api private + */ + request: function request(url, callback) { + var httpRequest = new AWS.HttpRequest(url); + httpRequest.method = 'GET'; + httpRequest.headers.Accept = 'application/json'; + var token = this.getECSAuthToken(); + if (token) { + httpRequest.headers.Authorization = token; + } + AWS.util.handleRequestWithRetries(httpRequest, this, callback); + }, + + /** + * Loads the credentials from the relative URI specified by container + * + * @callback callback function(err) + * Called when the request to the relative URI responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, `sessionToken`, and `expireTime` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + var fullUri; + + try { + fullUri = this.getECSFullUri(); + } catch (err) { + callback(err); + return; + } + + this.request(fullUri, function(err, data) { + if (!err) { + try { + data = JSON.parse(data); + var creds = self.formatCreds(data); + if (!self.credsFormatIsValid(creds)) { + throw AWS.util.error( + new Error('Response data is not in valid format'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + AWS.util.update(self, creds); + } catch (dataError) { + err = dataError; } - }, - 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" + } + callback(err, creds); + }); + } +}); + + +/***/ }), + +/***/ 5037: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var STS = __webpack_require__(7513); + +/** + * Represents credentials retrieved from STS SAML support. + * + * By default this provider gets credentials using the + * {AWS.STS.assumeRoleWithSAML} service operation. This operation + * requires a `RoleArn` containing the ARN of the IAM trust policy for the + * application for which credentials will be given, as well as a `PrincipalArn` + * representing the ARN for the SAML identity provider. In addition, the + * `SAMLAssertion` must be set to the token provided by the identity + * provider. See {constructor} for an example on creating a credentials + * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values. + * + * ## Refreshing Credentials from Identity Service + * + * In addition to AWS credentials expiring after a given amount of time, the + * login token from the identity provider will also expire. Once this token + * expires, it will not be usable to refresh AWS credentials, and another + * token will be needed. The SDK does not manage refreshing of the token value, + * but this can be done through a "refresh token" supported by most identity + * providers. Consult the documentation for the identity provider for refreshing + * tokens. Once the refreshed token is acquired, you should make sure to update + * this new token in the credentials object's {params} property. The following + * code will update the SAMLAssertion, assuming you have retrieved an updated + * token from the identity provider: + * + * ```javascript + * AWS.config.credentials.params.SAMLAssertion = updatedToken; + * ``` + * + * Future calls to `credentials.refresh()` will now use the new token. + * + * @!attribute params + * @return [map] the map of params passed to + * {AWS.STS.assumeRoleWithSAML}. To update the token, set the + * `params.SAMLAssertion` property. + */ +AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new credentials object. + * @param (see AWS.STS.assumeRoleWithSAML) + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.SAMLCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole', + * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal', + * SAMLAssertion: 'base64-token', // base64-encoded token from IdP + * }); + * @see AWS.STS.assumeRoleWithSAML + */ + constructor: function SAMLCredentials(params) { + AWS.Credentials.call(this); + this.expired = true; + this.params = params; + }, + + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithSAML} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.service.assumeRoleWithSAML(function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); + } + callback(err); + }); + }, + + /** + * @api private + */ + createClients: function() { + this.service = this.service || new STS({params: this.params}); + } + +}); + + +/***/ }), + +/***/ 3754: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var STS = __webpack_require__(7513); +var iniLoader = AWS.util.iniLoader; + +/** + * Represents credentials loaded from shared credentials file + * (defaulting to ~/.aws/credentials or defined by the + * `AWS_SHARED_CREDENTIALS_FILE` environment variable). + * + * ## Using the shared credentials file + * + * This provider is checked by default in the Node.js environment. To use the + * credentials file provider, simply add your access and secret keys to the + * ~/.aws/credentials file in the following format: + * + * [default] + * aws_access_key_id = AKID... + * aws_secret_access_key = YOUR_SECRET_KEY + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.SharedIniFileCredentials provider: + * + * ```javascript + * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser + */ +AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new SharedIniFileCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options disableAssumeRole [Boolean] (false) True to disable + * support for profiles that assume an IAM role. If true, and an assume + * role profile is selected, an error is raised. + * @option options preferStaticCredentials [Boolean] (false) True to + * prefer static credentials to role_arn if both are present. + * @option options tokenCodeFn [Function] (null) Function to provide + * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini + * file. Function is called with value of mfa_serial and callback, and + * should provide the TokenCode or an error to the callback in the format + * callback(err, token) + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + * @option options httpOptions [map] A set of options to pass to the low-level + * HTTP request. Currently supported options are: + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Defaults to the global + * agent (`http.globalAgent`) for non-SSL connections. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only available in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — Sets the socket to timeout after timeout + * milliseconds of inactivity on the socket. Defaults to two minutes + * (120000). + */ + constructor: function SharedIniFileCredentials(options) { + AWS.Credentials.call(this); + + options = options || {}; + + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.disableAssumeRole = Boolean(options.disableAssumeRole); + this.preferStaticCredentials = Boolean(options.preferStaticCredentials); + this.tokenCodeFn = options.tokenCodeFn || null; + this.httpOptions = options.httpOptions || null; + this.get(options.callback || AWS.util.fn.noop); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; + + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + + /* + In the CLI, the presence of both a role_arn and static credentials have + different meanings depending on how many profiles have been visited. For + the first profile processed, role_arn takes precedence over any static + credentials, but for all subsequent profiles, static credentials are + used if present, and only in their absence will the profile's + source_profile and role_arn keys be used to load another set of + credentials. This var is intended to yield compatible behaviour in this + sdk. + */ + var preferStaticCredentialsToRoleArn = Boolean( + this.preferStaticCredentials + && profile['aws_access_key_id'] + && profile['aws_secret_access_key'] + ); + + if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { + this.loadRoleProfile(profiles, profile, function(err, data) { + if (err) { + callback(err); + } else { + self.expired = false; + self.accessKeyId = data.Credentials.AccessKeyId; + self.secretAccessKey = data.Credentials.SecretAccessKey; + self.sessionToken = data.Credentials.SessionToken; + self.expireTime = data.Credentials.Expiration; + callback(null); + } + }); + return; + } + + this.accessKeyId = profile['aws_access_key_id']; + this.secretAccessKey = profile['aws_secret_access_key']; + this.sessionToken = profile['aws_session_token']; + + if (!this.accessKeyId || !this.secretAccessKey) { + throw AWS.util.error( + new Error('Credentials not set for profile ' + this.profile), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + this.expired = false; + callback(null); + } catch (err) { + callback(err); + } + }, + + /** + * Loads the credentials from the shared credentials file + * + * @callback callback function(err) + * Called after the shared INI file on disk is read and parsed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh( + callback || AWS.util.fn.callback, + this.disableAssumeRole + ); + }, + + /** + * @api private + */ + loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { + if (this.disableAssumeRole) { + throw AWS.util.error( + new Error('Role assumption profiles are disabled. ' + + 'Failed to load profile ' + this.profile + + ' from ' + creds.filename), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + + var self = this; + var roleArn = roleProfile['role_arn']; + var roleSessionName = roleProfile['role_session_name']; + var externalId = roleProfile['external_id']; + var mfaSerial = roleProfile['mfa_serial']; + var sourceProfileName = roleProfile['source_profile']; + + if (!sourceProfileName) { + throw AWS.util.error( + new Error('source_profile is not set using profile ' + this.profile), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + + var sourceProfileExistanceTest = creds[sourceProfileName]; + + if (typeof sourceProfileExistanceTest !== 'object') { + throw AWS.util.error( + new Error('source_profile ' + sourceProfileName + ' using profile ' + + this.profile + ' does not exist'), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + + var sourceCredentials = new AWS.SharedIniFileCredentials( + AWS.util.merge(this.options || {}, { + profile: sourceProfileName, + preferStaticCredentials: true + }) + ); + + this.roleArn = roleArn; + var sts = new STS({ + credentials: sourceCredentials, + httpOptions: this.httpOptions + }); + + var roleParams = { + RoleArn: roleArn, + RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() + }; + + if (externalId) { + roleParams.ExternalId = externalId; + } + + if (mfaSerial && self.tokenCodeFn) { + roleParams.SerialNumber = mfaSerial; + self.tokenCodeFn(mfaSerial, function(err, token) { + if (err) { + var message; + if (err instanceof Error) { + message = err.message; + } else { + message = err; + } + callback( + AWS.util.error( + new Error('Error fetching MFA token: ' + message), + { code: 'SharedIniFileCredentialsProviderFailure' } + )); + return; } - }, - url: "/teams/:team_id" + + roleParams.TokenCode = token; + sts.assumeRole(roleParams, callback); + }); + return; + } + sts.assumeRole(roleParams, callback); + } +}); + + +/***/ }), + +/***/ 7360: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var STS = __webpack_require__(7513); + +/** + * Represents temporary credentials retrieved from {AWS.STS}. Without any + * extra parameters, credentials will be fetched from the + * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the + * {AWS.STS.assumeRole} operation will be used to fetch credentials for the + * role instead. + * + * @note AWS.TemporaryCredentials is deprecated, but remains available for + * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the + * preferred class for temporary credentials. + * + * To setup temporary credentials, configure a set of master credentials + * using the standard credentials providers (environment, EC2 instance metadata, + * or from the filesystem), then set the global credentials to a new + * temporary credentials object: + * + * ```javascript + * // Note that environment credentials are loaded by default, + * // the following line is shown for clarity: + * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS'); + * + * // Now set temporary credentials seeded from the master credentials + * AWS.config.credentials = new AWS.TemporaryCredentials(); + * + * // subsequent requests will now use temporary credentials from AWS STS. + * new AWS.S3().listBucket(function(err, data) { ... }); + * ``` + * + * @!attribute masterCredentials + * @return [AWS.Credentials] the master (non-temporary) credentials used to + * get and refresh temporary credentials from AWS STS. + * @note (see constructor) + */ +AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new temporary credentials object. + * + * @note In order to create temporary credentials, you first need to have + * "master" credentials configured in {AWS.Config.credentials}. These + * master credentials are necessary to retrieve the temporary credentials, + * as well as refresh the credentials when they expire. + * @param params [map] a map of options that are passed to the + * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. + * If a `RoleArn` parameter is passed in, credentials will be based on the + * IAM role. + * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials + * used to get and refresh temporary credentials from AWS STS. + * @example Creating a new credentials object for generic temporary credentials + * AWS.config.credentials = new AWS.TemporaryCredentials(); + * @example Creating a new credentials object for an IAM role + * AWS.config.credentials = new AWS.TemporaryCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials', + * }); + * @see AWS.STS.assumeRole + * @see AWS.STS.getSessionToken + */ + constructor: function TemporaryCredentials(params, masterCredentials) { + AWS.Credentials.call(this); + this.loadMasterCredentials(masterCredentials); + this.expired = true; + + this.params = params || {}; + if (this.params.RoleArn) { + this.params.RoleSessionName = + this.params.RoleSessionName || 'temporary-credentials'; } }, - 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" + + /** + * Refreshes credentials using {AWS.STS.assumeRole} or + * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed + * to the credentials {constructor}. + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh (callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + */ + load: function load (callback) { + var self = this; + self.createClients(); + self.masterCredentials.get(function () { + self.service.config.credentials = self.masterCredentials; + var operation = self.params.RoleArn ? + self.service.assumeRole : self.service.getSessionToken; + operation.call(self.service, function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); } - }, - url: "/user/gpg_keys" - }, - listGpgKeysForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" + callback(err); + }); + }); + }, + + /** + * @api private + */ + loadMasterCredentials: function loadMasterCredentials (masterCredentials) { + this.masterCredentials = masterCredentials || AWS.config.credentials; + while (this.masterCredentials.masterCredentials) { + this.masterCredentials = this.masterCredentials.masterCredentials; + } + + if (typeof this.masterCredentials.get !== 'function') { + this.masterCredentials = new AWS.Credentials(this.masterCredentials); + } + }, + + /** + * @api private + */ + createClients: function () { + this.service = this.service || new STS({params: this.params}); + } + +}); + + +/***/ }), + +/***/ 1017: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var fs = __webpack_require__(5747); +var STS = __webpack_require__(7513); +var iniLoader = AWS.util.iniLoader; + +/** + * Represents OIDC credentials from a file on disk + * If the credentials expire, the SDK can {refresh} the credentials + * from the file. + * + * ## Using the web identity token file + * + * This provider is checked by default in the Node.js environment. To use + * the provider simply add your OIDC token to a file (ASCII encoding) and + * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment + * variable or web_identity_token_file shared config variable + * + * The file contains encoded OIDC token and the characters are + * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). + * JWT's are 3 base64 encoded strings joined by the '.' character. + * + * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE + * environment variable or web_identity_token_file shared config variable, + * and get the OIDC token from filename. + * It will also read IAM role to be assumed from AWS_ROLE_ARN + * environment variable or role_arn shared config variable. + * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity} + * service operation + * + * @!macro nobrowser + */ +AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { + + /** + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials( + * // optionally provide configuration to apply to the underlying AWS.STS service client + * // if configuration is not provided, then configuration will be pulled from AWS.config + * { + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } + * }); + * @see AWS.Config + */ + constructor: function TokenFileWebIdentityCredentials(clientConfig) { + AWS.Credentials.call(this); + this.data = null; + this.clientConfig = AWS.util.copy(clientConfig || {}); + }, + + /** + * Returns params from environment variables + * + * @api private + */ + getParamsFromEnv: function getParamsFromEnv() { + var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE', + ENV_ROLE_ARN = 'AWS_ROLE_ARN'; + if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) { + return [{ + envTokenFile: process.env[ENV_TOKEN_FILE], + roleArn: process.env[ENV_ROLE_ARN], + roleSessionName: process.env['AWS_ROLE_SESSION_NAME'] + }]; + } + }, + + /** + * Returns params from shared config variables + * + * @api private + */ + getParamsFromSharedConfig: function getParamsFromSharedConfig() { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader); + var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile; + var profile = profiles[profileName] || {}; + + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + profileName + ' not found'), + { code: 'TokenFileWebIdentityCredentialsProviderFailure' } + ); + } + + var paramsArray = []; + + while (!profile['web_identity_token_file'] && profile['source_profile']) { + paramsArray.unshift({ + roleArn: profile['role_arn'], + roleSessionName: profile['role_session_name'] + }); + var sourceProfile = profile['source_profile']; + profile = profiles[sourceProfile]; + } + + paramsArray.unshift({ + envTokenFile: profile['web_identity_token_file'], + roleArn: profile['role_arn'], + roleSessionName: profile['role_session_name'] + }); + + return paramsArray; + }, + + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see AWS.Credentials.get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + */ + assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) { + var self = this; + if (paramsArray.length === 0) { + self.service.credentialsFrom(self.data, self); + callback(); + } else { + var params = paramsArray.shift(); + self.service.config.credentials = self.service.credentialsFrom(self.data, self); + self.service.assumeRole( + { + RoleArn: params.roleArn, + RoleSessionName: params.roleSessionName || 'token-file-web-identity' }, - username: { - required: true, - type: "string" + function (err, data) { + self.data = null; + if (err) { + callback(err); + } else { + self.data = data; + self.assumeRoleChaining(paramsArray, callback); + } } - }, - url: "/users/:username/gpg_keys" - }, - listPublicEmails: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" + ); + } + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + try { + var paramsArray = self.getParamsFromEnv(); + if (!paramsArray) { + paramsArray = self.getParamsFromSharedConfig(); + } + if (paramsArray) { + var params = paramsArray.shift(); + var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'}); + if (!self.service) { + self.createClients(); } - }, - url: "/user/public_emails" - }, - listPublicKeys: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" + self.service.assumeRoleWithWebIdentity( + { + WebIdentityToken: oidcToken, + RoleArn: params.roleArn, + RoleSessionName: params.roleSessionName || 'token-file-web-identity' + }, + function (err, data) { + self.data = null; + if (err) { + callback(err); + } else { + self.data = data; + self.assumeRoleChaining(paramsArray, callback); + } + } + ); + } + } catch (err) { + callback(err); + } + }, + + /** + * @api private + */ + createClients: function() { + if (!this.service) { + var stsConfig = AWS.util.merge({}, this.clientConfig); + this.service = new STS(stsConfig); + + // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken + this.service.retryableError = function(error) { + if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') { + return true; + } else { + return AWS.Service.prototype.retryableError.call(this, error); } - }, - url: "/user/keys" - }, - listPublicKeysForUser: { - method: "GET", - params: { - page: { - type: "integer" - }, - per_page: { - type: "integer" - }, - username: { - required: true, - type: "string" + }; + } + } +}); + + +/***/ }), + +/***/ 4998: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var STS = __webpack_require__(7513); + +/** + * Represents credentials retrieved from STS Web Identity Federation support. + * + * By default this provider gets credentials using the + * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation + * requires a `RoleArn` containing the ARN of the IAM trust policy for the + * application for which credentials will be given. In addition, the + * `WebIdentityToken` must be set to the token provided by the identity + * provider. See {constructor} for an example on creating a credentials + * object with proper `RoleArn` and `WebIdentityToken` values. + * + * ## Refreshing Credentials from Identity Service + * + * In addition to AWS credentials expiring after a given amount of time, the + * login token from the identity provider will also expire. Once this token + * expires, it will not be usable to refresh AWS credentials, and another + * token will be needed. The SDK does not manage refreshing of the token value, + * but this can be done through a "refresh token" supported by most identity + * providers. Consult the documentation for the identity provider for refreshing + * tokens. Once the refreshed token is acquired, you should make sure to update + * this new token in the credentials object's {params} property. The following + * code will update the WebIdentityToken, assuming you have retrieved an updated + * token from the identity provider: + * + * ```javascript + * AWS.config.credentials.params.WebIdentityToken = updatedToken; + * ``` + * + * Future calls to `credentials.refresh()` will now use the new token. + * + * @!attribute params + * @return [map] the map of params passed to + * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the + * `params.WebIdentityToken` property. + * @!attribute data + * @return [map] the raw data response from the call to + * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get + * access to other properties from the response. + */ +AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new credentials object. + * @param (see AWS.STS.assumeRoleWithWebIdentity) + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.WebIdentityCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity', + * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service + * RoleSessionName: 'web' // optional name, defaults to web-identity + * }, { + * // optionally provide configuration to apply to the underlying AWS.STS service client + * // if configuration is not provided, then configuration will be pulled from AWS.config + * + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } + * }); + * @see AWS.STS.assumeRoleWithWebIdentity + * @see AWS.Config + */ + constructor: function WebIdentityCredentials(params, clientConfig) { + AWS.Credentials.call(this); + this.expired = true; + this.params = params; + this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity'; + this.data = null; + this._clientConfig = AWS.util.copy(clientConfig || {}); + }, + + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.service.assumeRoleWithWebIdentity(function (err, data) { + self.data = null; + if (!err) { + self.data = data; + self.service.credentialsFrom(data, self); + } + callback(err); + }); + }, + + /** + * @api private + */ + createClients: function() { + if (!this.service) { + var stsConfig = AWS.util.merge({}, this._clientConfig); + stsConfig.params = this.params; + this.service = new STS(stsConfig); + } + } + +}); + + +/***/ }), + +/***/ 5313: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var AWS = __webpack_require__(8437); +var util = __webpack_require__(7985); +var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED']; + +/** + * Generate key (except resources and operation part) to index the endpoints in the cache + * If input shape has endpointdiscoveryid trait then use + * accessKey + operation + resources + region + service as cache key + * If input shape doesn't have endpointdiscoveryid trait then use + * accessKey + region + service as cache key + * @return [map] object with keys to index endpoints. + * @api private + */ +function getCacheKey(request) { + var service = request.service; + var api = service.api || {}; + var operations = api.operations; + var identifiers = {}; + if (service.config.region) { + identifiers.region = service.config.region; + } + if (api.serviceId) { + identifiers.serviceId = api.serviceId; + } + if (service.config.credentials.accessKeyId) { + identifiers.accessKeyId = service.config.credentials.accessKeyId; + } + return identifiers; +} + +/** + * Recursive helper for marshallCustomIdentifiers(). + * Looks for required string input members that have 'endpointdiscoveryid' trait. + * @api private + */ +function marshallCustomIdentifiersHelper(result, params, shape) { + if (!shape || params === undefined || params === null) return; + if (shape.type === 'structure' && shape.required && shape.required.length > 0) { + util.arrayEach(shape.required, function(name) { + var memberShape = shape.members[name]; + if (memberShape.endpointDiscoveryId === true) { + var locationName = memberShape.isLocationName ? memberShape.name : name; + result[locationName] = String(params[name]); + } else { + marshallCustomIdentifiersHelper(result, params[name], memberShape); + } + }); + } +} + +/** + * Get custom identifiers for cache key. + * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. + * @param [object] request object + * @param [object] input shape of the given operation's api + * @api private + */ +function marshallCustomIdentifiers(request, shape) { + var identifiers = {}; + marshallCustomIdentifiersHelper(identifiers, request.params, shape); + return identifiers; +} + +/** + * Call endpoint discovery operation when it's optional. + * When endpoint is available in cache then use the cached endpoints. If endpoints + * are unavailable then use regional endpoints and call endpoint discovery operation + * asynchronously. This is turned off by default. + * @param [object] request object + * @api private + */ +function optionalDiscoverEndpoint(request) { + var service = request.service; + var api = service.api; + var operationModel = api.operations ? api.operations[request.operation] : undefined; + var inputShape = operationModel ? operationModel.input : undefined; + + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operationModel) cacheKey.operation = operationModel.name; + } + var endpoints = AWS.endpointCache.get(cacheKey); + if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { + //endpoint operation is being made but response not yet received + //or endpoint operation just failed in 1 minute + return; + } else if (endpoints && endpoints.length > 0) { + //found endpoint record from cache + request.httpRequest.updateEndpoint(endpoints[0].Address); + } else { + //endpoint record not in cache or outdated. make discovery operation + var endpointRequest = service.makeRequest(api.endpointOperation, { + Operation: operationModel.name, + Identifiers: identifiers, + }); + addApiVersionHeader(endpointRequest); + endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK); + //put in a placeholder for endpoints already requested, prevent + //too much in-flight calls + AWS.endpointCache.put(cacheKey, [{ + Address: '', + CachePeriodInMinutes: 1 + }]); + endpointRequest.send(function(err, data) { + if (data && data.Endpoints) { + AWS.endpointCache.put(cacheKey, data.Endpoints); + } else if (err) { + AWS.endpointCache.put(cacheKey, [{ + Address: '', + CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute + }]); + } + }); + } +} + +var requestQueue = {}; + +/** + * Call endpoint discovery operation when it's required. + * When endpoint is available in cache then use cached ones. If endpoints are + * unavailable then SDK should call endpoint operation then use returned new + * endpoint for the api call. SDK will automatically attempt to do endpoint + * discovery. This is turned off by default + * @param [object] request object + * @api private + */ +function requiredDiscoverEndpoint(request, done) { + var service = request.service; + var api = service.api; + var operationModel = api.operations ? api.operations[request.operation] : undefined; + var inputShape = operationModel ? operationModel.input : undefined; + + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operationModel) cacheKey.operation = operationModel.name; + } + var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey); + var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys + if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { + //endpoint operation is being made but response not yet received + //push request object to a pending queue + if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = []; + requestQueue[cacheKeyStr].push({request: request, callback: done}); + return; + } else if (endpoints && endpoints.length > 0) { + request.httpRequest.updateEndpoint(endpoints[0].Address); + done(); + } else { + var endpointRequest = service.makeRequest(api.endpointOperation, { + Operation: operationModel.name, + Identifiers: identifiers, + }); + endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + addApiVersionHeader(endpointRequest); + + //put in a placeholder for endpoints already requested, prevent + //too much in-flight calls + AWS.endpointCache.put(cacheKeyStr, [{ + Address: '', + CachePeriodInMinutes: 60 //long-live cache + }]); + endpointRequest.send(function(err, data) { + if (err) { + request.response.error = util.error(err, { retryable: false }); + AWS.endpointCache.remove(cacheKey); + + //fail all the pending requests in batch + if (requestQueue[cacheKeyStr]) { + var pendingRequests = requestQueue[cacheKeyStr]; + util.arrayEach(pendingRequests, function(requestContext) { + requestContext.request.response.error = util.error(err, { retryable: false }); + requestContext.callback(); + }); + delete requestQueue[cacheKeyStr]; } - }, - url: "/users/:username/keys" - }, - togglePrimaryEmailVisibility: { - method: "PATCH", - params: { - email: { - required: true, - type: "string" - }, - visibility: { - required: true, - type: "string" + } else if (data) { + AWS.endpointCache.put(cacheKeyStr, data.Endpoints); + request.httpRequest.updateEndpoint(data.Endpoints[0].Address); + + //update the endpoint for all the pending requests in batch + if (requestQueue[cacheKeyStr]) { + var pendingRequests = requestQueue[cacheKeyStr]; + util.arrayEach(pendingRequests, function(requestContext) { + requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address); + requestContext.callback(); + }); + delete requestQueue[cacheKeyStr]; } - }, - url: "/user/email/visibility" - }, - unblock: { - method: "DELETE", - params: { - username: { - required: true, - type: "string" + } + done(); + }); + } +} + +/** + * add api version header to endpoint operation + * @api private + */ +function addApiVersionHeader(endpointRequest) { + var api = endpointRequest.service.api; + var apiVersion = api.apiVersion; + if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { + endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; + } +} + +/** + * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid + * endpoint from cache. + * @api private + */ +function invalidateCachedEndpoints(response) { + var error = response.error; + var httpResponse = response.httpResponse; + if (error && + (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) + ) { + var request = response.request; + var operations = request.service.api.operations || {}; + var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; + } + AWS.endpointCache.remove(cacheKey); + } +} + +/** + * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. + * @param [object] client Service client object. + * @api private + */ +function hasCustomEndpoint(client) { + //if set endpoint is set for specific client, enable endpoint discovery will raise an error. + if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.' + }); + }; + var svcConfig = AWS.config[client.serviceIdentifier] || {}; + return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint)); +} + +/** + * @api private + */ +function isFalsy(value) { + return ['false', '0'].indexOf(value) >= 0; +} + +/** + * If endpoint discovery should perform for this request when no operation requires endpoint + * discovery for the given service. + * SDK performs config resolution in order like below: + * 1. If set in client configuration. + * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY. + * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'. + * @param [object] request request object. + * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this + * function returns undefined + * @api private + */ +function resolveEndpointDiscoveryConfig(request) { + var service = request.service || {}; + if (service.config.endpointDiscoveryEnabled !== undefined) { + return service.config.endpointDiscoveryEnabled; + } + + //shared ini file is only available in Node + //not to check env in browser + if (util.isBrowser()) return undefined; + + // If any of recognized endpoint discovery config env is set + for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { + var env = endpointDiscoveryEnabledEnvs[i]; + if (Object.prototype.hasOwnProperty.call(process.env, env)) { + if (process.env[env] === '' || process.env[env] === undefined) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'environmental variable ' + env + ' cannot be set to nothing' + }); + } + return !isFalsy(process.env[env]); + } + } + + var configFile = {}; + try { + configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ + isConfig: true, + filename: process.env[AWS.util.sharedConfigFileEnv] + }) : {}; + } catch (e) {} + var sharedFileConfig = configFile[ + process.env.AWS_PROFILE || AWS.util.defaultProfile + ] || {}; + if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { + if (sharedFileConfig.endpoint_discovery_enabled === undefined) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' + }); + } + return !isFalsy(sharedFileConfig.endpoint_discovery_enabled); + } + return undefined; +} + +/** + * attach endpoint discovery logic to request object + * @param [object] request + * @api private + */ +function discoverEndpoint(request, done) { + var service = request.service || {}; + if (hasCustomEndpoint(service) || request.isPresigned()) return done(); + + var operations = service.api.operations || {}; + var operationModel = operations[request.operation]; + var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL'; + var isEnabled = resolveEndpointDiscoveryConfig(request); + var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery; + if (isEnabled || hasRequiredEndpointDiscovery) { + // Once a customer enables endpoint discovery, the SDK should start appending + // the string endpoint-discovery to the user-agent on all requests. + request.httpRequest.appendToUserAgent('endpoint-discovery'); + } + switch (isEndpointDiscoveryRequired) { + case 'OPTIONAL': + if (isEnabled || hasRequiredEndpointDiscovery) { + // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery + // by default for all operations of that service, including operations where endpoint discovery is optional. + optionalDiscoverEndpoint(request); + request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); + } + done(); + break; + case 'REQUIRED': + if (isEnabled === false) { + // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client, + // then the SDK must return a clear and actionable exception. + request.response.error = util.error(new Error(), { + code: 'ConfigurationException', + message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation + + '() requires it. Please check your configurations.' + }); + done(); + break; + } + request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); + requiredDiscoverEndpoint(request, done); + break; + case 'NULL': + default: + done(); + break; + } +} + +module.exports = { + discoverEndpoint: discoverEndpoint, + requiredDiscoverEndpoint: requiredDiscoverEndpoint, + optionalDiscoverEndpoint: optionalDiscoverEndpoint, + marshallCustomIdentifiers: marshallCustomIdentifiers, + getCacheKey: getCacheKey, + invalidateCachedEndpoint: invalidateCachedEndpoints, +}; + + +/***/ }), + +/***/ 3727: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var eventMessageChunker = __webpack_require__(3630).eventMessageChunker; +var parseEvent = __webpack_require__(2123).parseEvent; + +function createEventStream(body, parser, model) { + var eventMessages = eventMessageChunker(body); + + var events = []; + + for (var i = 0; i < eventMessages.length; i++) { + events.push(parseEvent(parser, eventMessages[i], model)); + } + + return events; +} + +/** + * @api private + */ +module.exports = { + createEventStream: createEventStream +}; + + +/***/ }), + +/***/ 8518: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(8437).util; +var Transform = __webpack_require__(2413).Transform; +var allocBuffer = util.buffer.alloc; + +/** @type {Transform} */ +function EventMessageChunkerStream(options) { + Transform.call(this, options); + + this.currentMessageTotalLength = 0; + this.currentMessagePendingLength = 0; + /** @type {Buffer} */ + this.currentMessage = null; + + /** @type {Buffer} */ + this.messageLengthBuffer = null; +} + +EventMessageChunkerStream.prototype = Object.create(Transform.prototype); + +/** + * + * @param {Buffer} chunk + * @param {string} encoding + * @param {*} callback + */ +EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) { + var chunkLength = chunk.length; + var currentOffset = 0; + + while (currentOffset < chunkLength) { + // create new message if necessary + if (!this.currentMessage) { + // working on a new message, determine total length + var bytesRemaining = chunkLength - currentOffset; + // prevent edge case where total length spans 2 chunks + if (!this.messageLengthBuffer) { + this.messageLengthBuffer = allocBuffer(4); + } + var numBytesForTotal = Math.min( + 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer + bytesRemaining // bytes left in chunk + ); + + chunk.copy( + this.messageLengthBuffer, + this.currentMessagePendingLength, + currentOffset, + currentOffset + numBytesForTotal + ); + + this.currentMessagePendingLength += numBytesForTotal; + currentOffset += numBytesForTotal; + + if (this.currentMessagePendingLength < 4) { + // not enough information to create the current message + break; + } + this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)); + this.messageLengthBuffer = null; } - }, - url: "/user/blocks/:username" - }, - unfollow: { - method: "DELETE", - params: { - username: { - required: true, - type: "string" + + // write data into current message + var numBytesToWrite = Math.min( + this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message + chunkLength - currentOffset // number of bytes left in the original chunk + ); + chunk.copy( + this.currentMessage, // target buffer + this.currentMessagePendingLength, // target offset + currentOffset, // chunk offset + currentOffset + numBytesToWrite // chunk end to write + ); + this.currentMessagePendingLength += numBytesToWrite; + currentOffset += numBytesToWrite; + + // check if a message is ready to be pushed + if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) { + // push out the message + this.push(this.currentMessage); + // cleanup + this.currentMessage = null; + this.currentMessageTotalLength = 0; + this.currentMessagePendingLength = 0; } - }, - 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" + } + + callback(); +}; + +EventMessageChunkerStream.prototype._flush = function(callback) { + if (this.currentMessageTotalLength) { + if (this.currentMessageTotalLength === this.currentMessagePendingLength) { + callback(null, this.currentMessage); + } else { + callback(new Error('Truncated event message received.')); } - }, - url: "/user" + } else { + callback(); } - } }; -const VERSION = "2.4.0"; +/** + * @param {number} size Size of the message to be allocated. + * @api private + */ +EventMessageChunkerStream.prototype.allocateMessage = function(size) { + if (typeof size !== 'number') { + throw new Error('Attempted to allocate an event message where size was not a number: ' + size); + } + this.currentMessageTotalLength = size; + this.currentMessagePendingLength = 4; + this.currentMessage = allocBuffer(size); + this.currentMessage.writeUInt32BE(size, 0); +}; -function registerEndpoints(octokit, routes) { - Object.keys(routes).forEach(namespaceName => { - if (!octokit[namespaceName]) { - octokit[namespaceName] = {}; +/** + * @api private + */ +module.exports = { + EventMessageChunkerStream: EventMessageChunkerStream +}; + + +/***/ }), + +/***/ 3630: +/***/ ((module) => { + +/** + * Takes in a buffer of event messages and splits them into individual messages. + * @param {Buffer} buffer + * @api private + */ +function eventMessageChunker(buffer) { + /** @type Buffer[] */ + var messages = []; + var offset = 0; + + while (offset < buffer.length) { + var totalLength = buffer.readInt32BE(offset); + + // create new buffer for individual message (shares memory with original) + var message = buffer.slice(offset, totalLength + offset); + // increment offset to it starts at the next message + offset += totalLength; + + messages.push(message); } - 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 messages; +} - 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 +/** + * @api private + */ +module.exports = { + eventMessageChunker: eventMessageChunker +}; - 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()`); - } +/***/ }), + +/***/ 3773: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Transform = __webpack_require__(2413).Transform; +var parseEvent = __webpack_require__(2123).parseEvent; + +/** @type {Transform} */ +function EventUnmarshallerStream(options) { + options = options || {}; + // set output to object mode + options.readableObjectMode = true; + Transform.call(this, options); + this._readableState.objectMode = true; + + this.parser = options.parser; + this.eventStreamModel = options.eventStreamModel; +} + +EventUnmarshallerStream.prototype = Object.create(Transform.prototype); + +/** + * + * @param {Buffer} chunk + * @param {string} encoding + * @param {*} callback + */ +EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) { + try { + var event = parseEvent(this.parser, chunk, this.eventStreamModel); + this.push(event); + return callback(); + } catch (err) { + callback(err); + } +}; - 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; - } +/** + * @api private + */ +module.exports = { + EventUnmarshallerStream: EventUnmarshallerStream +}; - octokit[namespaceName][apiName] = request; - }); - }); -} -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]; - } +/***/ 8583: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - delete options[key]; - } - }); - return method(options); - }; +var util = __webpack_require__(8437).util; +var toBuffer = util.buffer.toBuffer; - Object.keys(method).forEach(key => { - patchedMethod[key] = method[key]; - }); - return patchedMethod; +/** + * A lossless representation of a signed, 64-bit integer. Instances of this + * class may be used in arithmetic expressions as if they were numeric + * primitives, but the binary representation will be preserved unchanged as the + * `bytes` property of the object. The bytes should be encoded as big-endian, + * two's complement integers. + * @param {Buffer} bytes + * + * @api private + */ +function Int64(bytes) { + if (bytes.length !== 8) { + throw new Error('Int64 buffers must be exactly 8 bytes'); + } + if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes); + + this.bytes = bytes; } /** - * 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. + * @param {number} number + * @returns {Int64} * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 + * @api private */ +Int64.fromNumber = function(number) { + if (number > 9223372036854775807 || number < -9223372036854775808) { + throw new Error( + number + ' is too large (or, if negative, too small) to represent as an Int64' + ); + } -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 + var bytes = new Uint8Array(8); + for ( + var i = 7, remaining = Math.abs(Math.round(number)); + i > -1 && remaining > 0; + i--, remaining /= 256 + ) { + bytes[i] = remaining; + } - [["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 + if (number < 0) { + negate(bytes); + } - return octokit[scope]; - } + return new Int64(bytes); +}; - }); - }); - return {}; -} -restEndpointMethods.VERSION = VERSION; +/** + * @returns {number} + * + * @api private + */ +Int64.prototype.valueOf = function() { + var bytes = this.bytes.slice(0); + var negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } -exports.restEndpointMethods = restEndpointMethods; -//# sourceMappingURL=index.js.map + return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1); +}; +Int64.prototype.toString = function() { + return String(this.valueOf()); +}; -/***/ }), -/* 251 */, -/* 252 */, -/* 253 */, -/* 254 */, -/* 255 */, -/* 256 */, -/* 257 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/** + * @param {Buffer} bytes + * + * @api private + */ +function negate(bytes) { + for (var i = 0; i < 8; i++) { + bytes[i] ^= 0xFF; + } + for (var i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) { + break; + } + } +} -"use strict"; +/** + * @api private + */ +module.exports = { + Int64: Int64 +}; -Object.defineProperty(exports, '__esModule', { value: true }); +/***/ }), -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } +/***/ 2123: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var deprecation = __webpack_require__(692); -var once = _interopDefault(__webpack_require__(969)); +var parseMessage = __webpack_require__(866).parseMessage; -const logOnce = once(deprecation => console.warn(deprecation)); /** - * Error with extra properties to help with debugging + * + * @param {*} parser + * @param {Buffer} message + * @param {*} shape + * @api private */ +function parseEvent(parser, message, shape) { + var parsedMessage = parseMessage(message); -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); + // check if message is an event or error + var messageType = parsedMessage.headers[':message-type']; + if (messageType) { + if (messageType.value === 'error') { + throw parseError(parsedMessage); + } else if (messageType.value !== 'event') { + // not sure how to parse non-events/non-errors, ignore for now + return; + } } - 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 + // determine event type + var eventType = parsedMessage.headers[':event-type']; + // check that the event type is modeled + var eventModel = shape.members[eventType.value]; + if (!eventModel) { + return; + } - const requestCopy = Object.assign({}, options.request); + var result = {}; + // check if an event payload exists + var eventPayloadMemberName = eventModel.eventPayloadMemberName; + if (eventPayloadMemberName) { + var payloadShape = eventModel.members[eventPayloadMemberName]; + // if the shape is binary, return the byte array + if (payloadShape.type === 'binary') { + result[eventPayloadMemberName] = parsedMessage.body; + } else { + result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape); + } + } - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); + // read event headers + var eventHeaderNames = eventModel.eventHeaderMemberNames; + for (var i = 0; i < eventHeaderNames.length; i++) { + var name = eventHeaderNames[i]; + if (parsedMessage.headers[name]) { + // parse the header! + result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value); + } } - 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; - } + var output = {}; + output[eventType.value] = result; + return output; +} +function parseError(message) { + var errorCode = message.headers[':error-code']; + var errorMessage = message.headers[':error-message']; + var error = new Error(errorMessage.value || errorMessage); + error.code = error.name = errorCode.value || errorCode; + return error; } -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map +/** + * @api private + */ +module.exports = { + parseEvent: parseEvent +}; /***/ }), -/* 258 */, -/* 259 */, -/* 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) +/***/ 866: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var EE = __webpack_require__(614) -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter -} +var Int64 = __webpack_require__(8583).Int64; -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 = {} +var splitMessage = __webpack_require__(2225).splitMessage; + +var BOOLEAN_TAG = 'boolean'; +var BYTE_TAG = 'byte'; +var SHORT_TAG = 'short'; +var INT_TAG = 'integer'; +var LONG_TAG = 'long'; +var BINARY_TAG = 'binary'; +var STRING_TAG = 'string'; +var TIMESTAMP_TAG = 'timestamp'; +var UUID_TAG = 'uuid'; + +/** + * @api private + * + * @param {Buffer} headers + */ +function parseHeaders(headers) { + var out = {}; + var position = 0; + while (position < headers.length) { + var nameLength = headers.readUInt8(position++); + var name = headers.slice(position, position + nameLength).toString(); + position += nameLength; + switch (headers.readUInt8(position++)) { + case 0 /* boolTrue */: + out[name] = { + type: BOOLEAN_TAG, + value: true + }; + break; + case 1 /* boolFalse */: + out[name] = { + type: BOOLEAN_TAG, + value: false + }; + break; + case 2 /* byte */: + out[name] = { + type: BYTE_TAG, + value: headers.readInt8(position++) + }; + break; + case 3 /* short */: + out[name] = { + type: SHORT_TAG, + value: headers.readInt16BE(position) + }; + position += 2; + break; + case 4 /* integer */: + out[name] = { + type: INT_TAG, + value: headers.readInt32BE(position) + }; + position += 4; + break; + case 5 /* long */: + out[name] = { + type: LONG_TAG, + value: new Int64(headers.slice(position, position + 8)) + }; + position += 8; + break; + case 6 /* byteArray */: + var binaryLength = headers.readUInt16BE(position); + position += 2; + out[name] = { + type: BINARY_TAG, + value: headers.slice(position, position + binaryLength) + }; + position += binaryLength; + break; + case 7 /* string */: + var stringLength = headers.readUInt16BE(position); + position += 2; + out[name] = { + type: STRING_TAG, + value: headers.slice( + position, + position + stringLength + ).toString() + }; + position += stringLength; + break; + case 8 /* timestamp */: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date( + new Int64(headers.slice(position, position + 8)) + .valueOf() + ) + }; + position += 8; + break; + case 9 /* uuid */: + var uuidChars = headers.slice(position, position + 16) + .toString('hex'); + position += 16; + out[name] = { + type: UUID_TAG, + value: uuidChars.substr(0, 8) + '-' + + uuidChars.substr(8, 4) + '-' + + uuidChars.substr(12, 4) + '-' + + uuidChars.substr(16, 4) + '-' + + uuidChars.substr(20) + }; + break; + default: + throw new Error('Unrecognized header type tag'); + } + } + return out; } -// 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 +function parseMessage(message) { + var parsed = splitMessage(message); + return { headers: parseHeaders(parsed.headers), body: parsed.body }; } -module.exports = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') +/** + * @api private + */ +module.exports = { + parseMessage: parseMessage +}; - 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() +/***/ 2225: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(8437).util; +var toBuffer = util.buffer.toBuffer; + +// All prelude components are unsigned, 32-bit integers +var PRELUDE_MEMBER_LENGTH = 4; +// The prelude consists of two components +var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; +// Checksums are always CRC32 hashes. +var CHECKSUM_LENGTH = 4; +// Messages must include a full prelude, a prelude checksum, and a message checksum +var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; + +/** + * @api private + * + * @param {Buffer} message + */ +function splitMessage(message) { + if (!util.Buffer.isBuffer(message)) message = toBuffer(message); + + if (message.length < MINIMUM_MESSAGE_LENGTH) { + throw new Error('Provided message too short to accommodate event stream message overhead'); } - } - emitter.on(ev, cb) - return remove -} + if (message.length !== message.readUInt32BE(0)) { + throw new Error('Reported message length does not match received message length'); + } -module.exports.unload = unload -function unload () { - if (!loaded) { - return - } - loaded = false + var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 -} + if ( + expectedPreludeChecksum !== util.crypto.crc32( + message.slice(0, PRELUDE_LENGTH) + ) + ) { + throw new Error( + 'The prelude checksum specified in the message (' + + expectedPreludeChecksum + + ') does not match the calculated CRC32 checksum.' + ); + } -function emit (event, code, signal) { - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) -} + var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); -// { : , ... } -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) + if ( + expectedMessageChecksum !== util.crypto.crc32( + message.slice(0, message.length - CHECKSUM_LENGTH) + ) + ) { + throw new Error( + 'The message checksum did not match the expected value of ' + + expectedMessageChecksum + ); } - } -}) -module.exports.signals = function () { - return signals + var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; + var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); + + return { + headers: message.slice(headersStart, headersEnd), + body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), + }; } -module.exports.load = load +/** + * @api private + */ +module.exports = { + splitMessage: splitMessage +}; -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 +/***/ 9643: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) +/** + * What is necessary to create an event stream in node? + * - http response stream + * - parser + * - event stream model + */ - process.emit = processEmit - process.reallyExit = processReallyExit -} +var EventMessageChunkerStream = __webpack_require__(8518).EventMessageChunkerStream; +var EventUnmarshallerStream = __webpack_require__(3773).EventUnmarshallerStream; -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) -} +function createEventStream(stream, parser, model) { + var eventStream = new EventUnmarshallerStream({ + parser: parser, + eventStreamModel: model + }); -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) - } -} + var eventMessageChunker = new EventMessageChunkerStream(); + stream.pipe( + eventMessageChunker + ).pipe(eventStream); -/***/ }), -/* 261 */, -/* 262 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + stream.on('error', function(err) { + eventMessageChunker.emit('error', err); + }); -"use strict"; + eventMessageChunker.on('error', function(err) { + eventStream.emit('error', err); + }); -Object.defineProperty(exports, "__esModule", { value: true }); -const fs_1 = __webpack_require__(747); -const os_1 = __webpack_require__(87); -class Context { - /** - * Hydrate the context from the environment - */ - constructor() { - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); - } - else { - const path = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); - } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); - } + return eventStream; } -exports.Context = Context; -//# sourceMappingURL=context.js.map -/***/ }), -/* 263 */, -/* 264 */, -/* 265 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/** + * @api private + */ +module.exports = { + createEventStream: createEventStream +}; -module.exports = getPage -const deprecate = __webpack_require__(370) -const getPageLinks = __webpack_require__(577) -const HttpError = __webpack_require__(297) +/***/ }), -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] +/***/ 4995: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - if (!url) { - const urlError = new HttpError(`No ${which} page found`, 404) - return Promise.reject(urlError) - } +var AWS = __webpack_require__(8437); +var SequentialExecutor = __webpack_require__(5948); +var DISCOVER_ENDPOINT = __webpack_require__(5313).discoverEndpoint; +/** + * The namespace used to register global event listeners for request building + * and sending. + */ +AWS.EventListeners = { + /** + * @!attribute VALIDATE_CREDENTIALS + * A request listener that validates whether the request is being + * sent with credentials. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating credentials + * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS; + * request.removeListener('validate', listener); + * @readonly + * @return [Function] + * @!attribute VALIDATE_REGION + * A request listener that validates whether the region is set + * for a request. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating region configuration + * var listener = AWS.EventListeners.Core.VALIDATE_REGION; + * request.removeListener('validate', listener); + * @readonly + * @return [Function] + * @!attribute VALIDATE_PARAMETERS + * A request listener that validates input parameters in a request. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating parameters + * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS; + * request.removeListener('validate', listener); + * @example Disable parameter validation globally + * AWS.EventListeners.Core.removeListener('validate', + * AWS.EventListeners.Core.VALIDATE_REGION); + * @readonly + * @return [Function] + * @!attribute SEND + * A request listener that initiates the HTTP connection for a + * request being sent. Handles the {AWS.Request~send 'send' Request event} + * @example Replacing the HTTP handler + * var listener = AWS.EventListeners.Core.SEND; + * request.removeListener('send', listener); + * request.on('send', function(response) { + * customHandler.send(response); + * }); + * @return [Function] + * @readonly + * @!attribute HTTP_DATA + * A request listener that reads data from the HTTP connection in order + * to build the response data. + * Handles the {AWS.Request~httpData 'httpData' Request event}. + * Remove this handler if you are overriding the 'httpData' event and + * do not want extra data processing and buffering overhead. + * @example Disabling default data processing + * var listener = AWS.EventListeners.Core.HTTP_DATA; + * request.removeListener('httpData', listener); + * @return [Function] + * @readonly + */ + Core: {} /* doc hack */ +}; - const requestOptions = { - url, - headers: applyAcceptHeader(link, headers) +/** + * @api private + */ +function getOperationAuthtype(req) { + if (!req.service.api.operations) { + return ''; } + var operation = req.service.api.operations[req.operation]; + return operation ? operation.authtype : ''; +} - const promise = octokit.request(requestOptions) +AWS.EventListeners = { + Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { + addAsync('VALIDATE_CREDENTIALS', 'validate', + function VALIDATE_CREDENTIALS(req, done) { + if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none + req.service.config.getCredentials(function(err) { + if (err) { + req.response.error = AWS.util.error(err, + {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'}); + } + done(); + }); + }); - return promise -} + add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { + if (!req.service.isGlobalEndpoint) { + var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!req.service.config.region) { + req.response.error = AWS.util.error(new Error(), + {code: 'ConfigError', message: 'Missing region in config'}); + } else if (!dnsHostRegex.test(req.service.config.region)) { + req.response.error = AWS.util.error(new Error(), + {code: 'ConfigError', message: 'Invalid region in config'}); + } + } + }); -function applyAcceptHeader (res, headers) { - const previous = res.headers && res.headers['x-github-media-type'] + add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) { + if (!req.service.api.operations) { + return; + } + var operation = req.service.api.operations[req.operation]; + if (!operation) { + return; + } + var idempotentMembers = operation.idempotentMembers; + if (!idempotentMembers.length) { + return; + } + // creates a copy of params so user's param object isn't mutated + var params = AWS.util.copy(req.params); + for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) { + if (!params[idempotentMembers[i]]) { + // add the member + params[idempotentMembers[i]] = AWS.util.uuid.v4(); + } + } + req.params = params; + }); - if (!previous || (headers && headers.accept)) { - return headers - } - headers = headers || {} - headers.accept = 'application/vnd.' + previous - .replace('; param=', '.') - .replace('; format=', '+') + add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) { + if (!req.service.api.operations) { + return; + } + var rules = req.service.api.operations[req.operation].input; + var validation = req.service.config.paramValidation; + new AWS.ParamValidator(validation).validate(rules, req.params); + }); - return headers -} + addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) { + req.haltHandlersOnError(); + if (!req.service.api.operations) { + return; + } + var operation = req.service.api.operations[req.operation]; + var authtype = operation ? operation.authtype : ''; + if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none + if (req.service.getSignerClass(req) === AWS.Signers.V4) { + var body = req.httpRequest.body || ''; + if (authtype.indexOf('unsigned-body') >= 0) { + req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; + return done(); + } + AWS.util.computeSha256(body, function(err, sha) { + if (err) { + done(err); + } + else { + req.httpRequest.headers['X-Amz-Content-Sha256'] = sha; + done(); + } + }); + } else { + done(); + } + }); + add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) { + var authtype = getOperationAuthtype(req); + var payloadMember = AWS.util.getRequestPayloadShape(req); + if (req.httpRequest.headers['Content-Length'] === undefined) { + try { + var length = AWS.util.string.byteLength(req.httpRequest.body); + req.httpRequest.headers['Content-Length'] = length; + } catch (err) { + if (payloadMember && payloadMember.isStreaming) { + if (payloadMember.requiresLength) { + //streaming payload requires length(s3, glacier) + throw err; + } else if (authtype.indexOf('unsigned-body') >= 0) { + //unbounded streaming payload(lex, mediastore) + req.httpRequest.headers['Transfer-Encoding'] = 'chunked'; + return; + } else { + throw err; + } + } + throw err; + } + } + }); -/***/ }), -/* 266 */, -/* 267 */, -/* 268 */, -/* 269 */, -/* 270 */ -/***/ (function(module) { + add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) { + req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; + }); -module.exports = {"pagination":{}}; + add('RESTART', 'restart', function RESTART() { + var err = this.response.error; + if (!err || !err.retryable) return; -/***/ }), -/* 271 */, -/* 272 */, -/* 273 */, -/* 274 */, -/* 275 */, -/* 276 */, -/* 277 */, -/* 278 */, -/* 279 */, -/* 280 */ -/***/ (function(module, exports) { + this.httpRequest = new AWS.HttpRequest( + this.service.endpoint, + this.service.region + ); -exports = module.exports = SemVer + if (this.response.retryCount < this.service.config.maxRetries) { + this.response.retryCount++; + } else { + this.response.error = null; + } + }); -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 () {} -} + var addToHead = true; + addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead); -// 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' + addAsync('SIGN', 'sign', function SIGN(req, done) { + var service = req.service; + var operations = req.service.api.operations || {}; + var operation = operations[req.operation]; + var authtype = operation ? operation.authtype : ''; + if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 + service.config.getCredentials(function (err, credentials) { + if (err) { + req.response.error = err; + return done(); + } -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 + try { + var date = service.getSkewCorrectedDate(); + var SignerClass = service.getSignerClass(req); + var signer = new SignerClass(req.httpRequest, + service.api.signingName || service.api.endpointPrefix, + { + signatureCache: service.config.signatureCache, + operation: operation, + signatureVersion: service.api.signatureVersion + }); + signer.setServiceClientId(service._clientId); -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var R = 0 + // clear old authorization headers + delete req.httpRequest.headers['Authorization']; + delete req.httpRequest.headers['Date']; + delete req.httpRequest.headers['X-Amz-Date']; -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. + // add new authorization + signer.addAuthorization(credentials, date); + req.signedAt = date; + } catch (e) { + req.response.error = e; + } + done(); + }); + }); -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. + add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { + if (this.service.successfulResponse(resp, this)) { + resp.data = {}; + resp.error = null; + } else { + resp.data = null; + resp.error = AWS.util.error(new Error(), + {code: 'UnknownError', message: 'An unknown error occurred.'}); + } + }); -var NUMERICIDENTIFIER = R++ -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' -var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' + addAsync('SEND', 'send', function SEND(resp, done) { + resp.httpResponse._abortCallback = done; + resp.error = null; + resp.data = null; -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. + function callback(httpResp) { + resp.httpResponse.stream = httpResp; + var stream = resp.request.httpRequest.stream; + var service = resp.request.service; + var api = service.api; + var operationName = resp.request.operation; + var operation = api.operations[operationName] || {}; -var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) { + resp.request.emit( + 'httpHeaders', + [statusCode, headers, resp, statusMessage] + ); -// ## Main Version -// Three dot-separated numeric identifiers. + if (!resp.httpResponse.streaming) { + if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check + // if we detect event streams, we're going to have to + // return the stream immediately + if (operation.hasEventOutput && service.successfulResponse(resp)) { + // skip reading the IncomingStream + resp.request.emit('httpDone'); + done(); + return; + } -var MAINVERSION = R++ -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')' + httpResp.on('readable', function onReadable() { + var data = httpResp.read(); + if (data !== null) { + resp.request.emit('httpData', [data, resp]); + } + }); + } else { // legacy streams API + httpResp.on('data', function onData(data) { + resp.request.emit('httpData', [data, resp]); + }); + } + } + }); -var MAINVERSIONLOOSE = R++ -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')' + httpResp.on('end', function onEnd() { + if (!stream || !stream.didCallback) { + if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) { + // don't concatenate response chunks when streaming event stream data when response is successful + return; + } + resp.request.emit('httpDone'); + done(); + } + }); + } -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. + function progress(httpResp) { + httpResp.on('sendProgress', function onSendProgress(value) { + resp.request.emit('httpUploadProgress', [value, resp]); + }); -var PRERELEASEIDENTIFIER = R++ -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')' + httpResp.on('receiveProgress', function onReceiveProgress(value) { + resp.request.emit('httpDownloadProgress', [value, resp]); + }); + } + + function error(err) { + if (err.code !== 'RequestAbortedError') { + var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError'; + err = AWS.util.error(err, { + code: errCode, + region: resp.request.httpRequest.region, + hostname: resp.request.httpRequest.endpoint.hostname, + retryable: true + }); + } + resp.error = err; + resp.request.emit('httpError', [resp.error, resp], function() { + done(); + }); + } + + function executeSend() { + var http = AWS.HttpClient.getInstance(); + var httpOptions = resp.request.service.config.httpOptions || {}; + try { + var stream = http.handleRequest(resp.request.httpRequest, httpOptions, + callback, error); + progress(stream); + } catch (err) { + error(err); + } + } + var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000; + if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign + this.emit('sign', [this], function(err) { + if (err) done(err); + else executeSend(); + }); + } else { + executeSend(); + } + }); -var PRERELEASEIDENTIFIERLOOSE = R++ -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')' + add('HTTP_HEADERS', 'httpHeaders', + function HTTP_HEADERS(statusCode, headers, resp, statusMessage) { + resp.httpResponse.statusCode = statusCode; + resp.httpResponse.statusMessage = statusMessage; + resp.httpResponse.headers = headers; + resp.httpResponse.body = AWS.util.buffer.toBuffer(''); + resp.httpResponse.buffers = []; + resp.httpResponse.numBytes = 0; + var dateHeader = headers.date || headers.Date; + var service = resp.request.service; + if (dateHeader) { + var serverTime = Date.parse(dateHeader); + if (service.config.correctClockSkew + && service.isClockSkewed(serverTime)) { + service.applyClockOffset(serverTime); + } + } + }); -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. + add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) { + if (chunk) { + if (AWS.util.isNode()) { + resp.httpResponse.numBytes += chunk.length; -var PRERELEASE = R++ -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' + var total = resp.httpResponse.headers['content-length']; + var progress = { loaded: resp.httpResponse.numBytes, total: total }; + resp.request.emit('httpDownloadProgress', [progress, resp]); + } -var PRERELEASELOOSE = R++ -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' + resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk)); + } + }); -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. + add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) { + // convert buffers array into single buffer + if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) { + var body = AWS.util.buffer.concat(resp.httpResponse.buffers); + resp.httpResponse.body = body; + } + delete resp.httpResponse.numBytes; + delete resp.httpResponse.buffers; + }); -var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) { + if (resp.httpResponse.statusCode) { + resp.error.statusCode = resp.httpResponse.statusCode; + if (resp.error.retryable === undefined) { + resp.error.retryable = this.service.retryableError(resp.error, this); + } + } + }); -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. + add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) { + if (!resp.error) return; + switch (resp.error.code) { + case 'RequestExpired': // EC2 only + case 'ExpiredTokenException': + case 'ExpiredToken': + resp.error.retryable = true; + resp.request.service.config.credentials.expired = true; + } + }); -var BUILD = R++ -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) { + var err = resp.error; + if (!err) return; + if (typeof err.code === 'string' && typeof err.message === 'string') { + if (err.code.match(/Signature/) && err.message.match(/expired/)) { + resp.error.retryable = true; + } + } + }); -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) { + if (!resp.error) return; + if (this.service.clockSkewError(resp.error) + && this.service.config.correctClockSkew) { + resp.error.retryable = true; + } + }); -// 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. + add('REDIRECT', 'retry', function REDIRECT(resp) { + if (resp.error && resp.error.statusCode >= 300 && + resp.error.statusCode < 400 && resp.httpResponse.headers['location']) { + this.httpRequest.endpoint = + new AWS.Endpoint(resp.httpResponse.headers['location']); + this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host; + resp.error.redirect = true; + resp.error.retryable = true; + } + }); -var FULL = R++ -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?' + add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) { + if (resp.error) { + if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { + resp.error.retryDelay = 0; + } else if (resp.retryCount < resp.maxRetries) { + resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0; + } + } + }); -src[FULL] = '^' + FULLPLAIN + '$' + addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) { + var delay, willRetry = false; -// 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] + '?' + if (resp.error) { + delay = resp.error.retryDelay || 0; + if (resp.error.retryable && resp.retryCount < resp.maxRetries) { + resp.retryCount++; + willRetry = true; + } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { + resp.redirectCount++; + willRetry = true; + } + } -var LOOSE = R++ -src[LOOSE] = '^' + LOOSEPLAIN + '$' + // delay < 0 is a signal from customBackoff to skip retries + if (willRetry && delay >= 0) { + resp.error = null; + setTimeout(done, delay); + } else { + done(); + } + }); + }), -var GTLT = R++ -src[GTLT] = '((?:<|>)?=?)' + CorePost: new SequentialExecutor().addNamedListeners(function(add) { + add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId); + add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId); -// 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|\\*' + add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) { + function isDNSError(err) { + return err.errno === 'ENOTFOUND' || + typeof err.errno === 'number' && + typeof AWS.util.getSystemErrorName === 'function' && + ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0); + } + if (err.code === 'NetworkingError' && isDNSError(err)) { + var message = 'Inaccessible host: `' + err.hostname + + '\'. This service may not be available in the `' + err.region + + '\' region.'; + this.response.error = AWS.util.error(new Error(message), { + code: 'UnknownEndpoint', + region: err.region, + hostname: err.hostname, + retryable: true, + originalError: err + }); + } + }); + }), -var XRANGEPLAIN = R++ -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?' + Logger: new SequentialExecutor().addNamedListeners(function(add) { + add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) { + var req = resp.request; + var logger = req.service.config.logger; + if (!logger) return; + function filterSensitiveLog(inputShape, shape) { + if (!shape) { + return shape; + } + if (inputShape.isSensitive) { + return '***SensitiveInformation***'; + } + switch (inputShape.type) { + case 'structure': + var struct = {}; + AWS.util.each(shape, function(subShapeName, subShape) { + if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) { + struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape); + } else { + struct[subShapeName] = subShape; + } + }); + return struct; + case 'list': + var list = []; + AWS.util.arrayEach(shape, function(subShape, index) { + list.push(filterSensitiveLog(inputShape.member, subShape)); + }); + return list; + case 'map': + var map = {}; + AWS.util.each(shape, function(key, value) { + map[key] = filterSensitiveLog(inputShape.value, value); + }); + return map; + default: + return shape; + } + } -var XRANGEPLAINLOOSE = R++ -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?' + function buildMessage() { + var time = resp.request.service.getSkewCorrectedDate().getTime(); + var delta = (time - req.startTime.getTime()) / 1000; + var ansi = logger.isTTY ? true : false; + var status = resp.httpResponse.statusCode; + var censoredParams = req.params; + if ( + req.service.api.operations && + req.service.api.operations[req.operation] && + req.service.api.operations[req.operation].input + ) { + var inputShape = req.service.api.operations[req.operation].input; + censoredParams = filterSensitiveLog(inputShape, req.params); + } + var params = __webpack_require__(1669).inspect(censoredParams, true, null); + var message = ''; + if (ansi) message += '\x1B[33m'; + message += '[AWS ' + req.service.serviceIdentifier + ' ' + status; + message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]'; + if (ansi) message += '\x1B[0;1m'; + message += ' ' + AWS.util.string.lowerFirst(req.operation); + message += '(' + params + ')'; + if (ansi) message += '\x1B[0m'; + return message; + } -var XRANGE = R++ -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' -var XRANGELOOSE = R++ -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' + var line = buildMessage(); + if (typeof logger.log === 'function') { + logger.log(line); + } else if (typeof logger.write === 'function') { + logger.write(line + '\n'); + } + }); + }), -// 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])' + Json: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __webpack_require__(83); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++ -src[LONETILDE] = '(?:~>?)' + Rest: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __webpack_require__(8200); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -var TILDETRIM = R++ -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') -var tildeTrimReplace = '$1~' + RestJson: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __webpack_require__(5883); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -var TILDE = R++ -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' -var TILDELOOSE = R++ -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' + RestXml: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __webpack_require__(5143); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++ -src[LONECARET] = '(?:\\^)' + Query: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __webpack_require__(761); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }) +}; -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 + ')$|^$' +/***/ 1556: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -// 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] + ')' +var AWS = __webpack_require__(8437); +var inherit = AWS.util.inherit; -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' +/** + * The endpoint that a service will talk to, for example, + * `'https://ec2.ap-southeast-1.amazonaws.com'`. If + * you need to override an endpoint for a service, you can + * set the endpoint on a service by passing the endpoint + * object with the `endpoint` option key: + * + * ```javascript + * var ep = new AWS.Endpoint('awsproxy.example.com'); + * var s3 = new AWS.S3({endpoint: ep}); + * s3.service.endpoint.hostname == 'awsproxy.example.com' + * ``` + * + * Note that if you do not specify a protocol, the protocol will + * be selected based on your current {AWS.config} configuration. + * + * @!attribute protocol + * @return [String] the protocol (http or https) of the endpoint + * URL + * @!attribute hostname + * @return [String] the host portion of the endpoint, e.g., + * example.com + * @!attribute host + * @return [String] the host portion of the endpoint including + * the port, e.g., example.com:80 + * @!attribute port + * @return [Integer] the port of the endpoint + * @!attribute href + * @return [String] the full URL of the endpoint + */ +AWS.Endpoint = inherit({ -// 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*$' + /** + * @overload Endpoint(endpoint) + * Constructs a new endpoint given an endpoint URL. If the + * URL omits a protocol (http or https), the default protocol + * set in the global {AWS.config} will be used. + * @param endpoint [String] the URL to construct an endpoint from + */ + constructor: function Endpoint(endpoint, config) { + AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']); -var HYPHENRANGELOOSE = R++ -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$' + if (typeof endpoint === 'undefined' || endpoint === null) { + throw new Error('Invalid endpoint: ' + endpoint); + } else if (typeof endpoint !== 'string') { + return AWS.util.copy(endpoint); + } -// Star ranges basically just allow anything at all. -var STAR = R++ -src[STAR] = '(<|>)?=?\\s*\\*' + if (!endpoint.match(/^http/)) { + var useSSL = config && config.sslEnabled !== undefined ? + config.sslEnabled : AWS.config.sslEnabled; + endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint; + } -// 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]) - } -} + AWS.util.update(this, AWS.util.urlParse(endpoint)); -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + // Ensure the port property is set as an integer + if (this.port) { + this.port = parseInt(this.port, 10); + } else { + this.port = this.protocol === 'https:' ? 443 : 80; } } - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } +}); - if (version.length > MAX_LENGTH) { - return null - } +/** + * The low level HTTP request object, encapsulating all HTTP header + * and body data sent by a service request. + * + * @!attribute method + * @return [String] the HTTP method of the request + * @!attribute path + * @return [String] the path portion of the URI, e.g., + * "/list/?start=5&num=10" + * @!attribute headers + * @return [map] + * a map of header keys and their respective values + * @!attribute body + * @return [String] the request body payload + * @!attribute endpoint + * @return [AWS.Endpoint] the endpoint for the request + * @!attribute region + * @api private + * @return [String] the region, for signing purposes only. + */ +AWS.HttpRequest = inherit({ - var r = options.loose ? re[LOOSE] : re[FULL] - if (!r.test(version)) { - return null - } + /** + * @api private + */ + constructor: function HttpRequest(endpoint, region) { + endpoint = new AWS.Endpoint(endpoint); + this.method = 'POST'; + this.path = endpoint.path || '/'; + this.headers = {}; + this.body = ''; + this.endpoint = endpoint; + this.region = region; + this._userAgent = ''; + this.setUserAgent(); + }, - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} + /** + * @api private + */ + setUserAgent: function setUserAgent() { + this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent(); + }, -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} + getUserAgentHeaderName: function getUserAgentHeaderName() { + var prefix = AWS.util.isBrowser() ? 'X-Amz-' : ''; + return prefix + 'User-Agent'; + }, -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} + /** + * @api private + */ + appendToUserAgent: function appendToUserAgent(agentPartial) { + if (typeof agentPartial === 'string' && agentPartial) { + this._userAgent += ' ' + agentPartial; + } + this.headers[this.getUserAgentHeaderName()] = this._userAgent; + }, -exports.SemVer = SemVer + /** + * @api private + */ + getUserAgent: function getUserAgent() { + return this._userAgent; + }, -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + /** + * @return [String] the part of the {path} excluding the + * query string + */ + pathname: function pathname() { + return this.path.split('?', 1)[0]; + }, + + /** + * @return [String] the query string portion of the {path} + */ + search: function search() { + var query = this.path.split('?', 2)[1]; + if (query) { + query = AWS.util.queryStringParse(query); + return AWS.util.queryParamsToString(query); } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version + return ''; + }, + + /** + * @api private + * update httpRequest endpoint with endpoint string + */ + updateEndpoint: function updateEndpoint(endpointStr) { + var newEndpoint = new AWS.Endpoint(endpointStr); + this.endpoint = newEndpoint; + this.path = newEndpoint.path || '/'; + if (this.headers['Host']) { + this.headers['Host'] = newEndpoint.host; } - } 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') - } +/** + * The low level HTTP response object, encapsulating all HTTP header + * and body data returned from the request. + * + * @!attribute statusCode + * @return [Integer] the HTTP status code of the response (e.g., 200, 404) + * @!attribute headers + * @return [map] + * a map of response header keys and their respective values + * @!attribute body + * @return [String] the response body payload + * @!attribute [r] streaming + * @return [Boolean] whether this response is being streamed at a low-level. + * Defaults to `false` (buffered reads). Do not modify this manually, use + * {createUnbufferedStream} to convert the stream to unbuffered mode + * instead. + */ +AWS.HttpResponse = inherit({ - if (!(this instanceof SemVer)) { - return new SemVer(version, options) + /** + * @api private + */ + constructor: function HttpResponse() { + this.statusCode = undefined; + this.headers = {}; + this.body = undefined; + this.streaming = false; + this.stream = null; + }, + + /** + * Disables buffering on the HTTP response and returns the stream for reading. + * @return [Stream, XMLHttpRequest, null] the underlying stream object. + * Use this object to directly read data off of the stream. + * @note This object is only available after the {AWS.Request~httpHeaders} + * event has fired. This method must be called prior to + * {AWS.Request~httpData}. + * @example Taking control of a stream + * request.on('httpHeaders', function(statusCode, headers) { + * if (statusCode < 300) { + * if (headers.etag === 'xyz') { + * // pipe the stream, disabling buffering + * var stream = this.response.httpResponse.createUnbufferedStream(); + * stream.pipe(process.stdout); + * } else { // abort this request and set a better error message + * this.abort(); + * this.response.error = new Error('Invalid ETag'); + * } + * } + * }).send(console.log); + */ + createUnbufferedStream: function createUnbufferedStream() { + this.streaming = true; + return this.stream; } +}); - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) +AWS.HttpClient = inherit({}); - if (!m) { - throw new TypeError('Invalid Version: ' + version) +/** + * @api private + */ +AWS.HttpClient.getInstance = function getInstance() { + if (this.singleton === undefined) { + this.singleton = new this(); } + return this.singleton; +}; - 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') - } +/***/ 2310: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } +var AWS = __webpack_require__(8437); +var Stream = AWS.util.stream.Stream; +var TransformStream = AWS.util.stream.Transform; +var ReadableStream = AWS.util.stream.Readable; +__webpack_require__(1556); +var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED'; - // 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 - } +/** + * @api private + */ +AWS.NodeHttpClient = AWS.util.inherit({ + handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) { + var self = this; + var endpoint = httpRequest.endpoint; + var pathPrefix = ''; + if (!httpOptions) httpOptions = {}; + if (httpOptions.proxy) { + pathPrefix = endpoint.protocol + '//' + endpoint.hostname; + if (endpoint.port !== 80 && endpoint.port !== 443) { + pathPrefix += ':' + endpoint.port; } - return id - }) - } + endpoint = new AWS.Endpoint(httpOptions.proxy); + } - this.build = m[5] ? m[5].split('.') : [] - this.format() -} + var useSSL = endpoint.protocol === 'https:'; + var http = useSSL ? __webpack_require__(7211) : __webpack_require__(8605); + var options = { + host: endpoint.hostname, + port: endpoint.port, + method: httpRequest.method, + headers: httpRequest.headers, + path: pathPrefix + httpRequest.path + }; -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} + if (!httpOptions.agent) { + options.agent = this.getAgent(useSSL, { + keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false + }); + } -SemVer.prototype.toString = function () { - return this.version -} + AWS.util.update(options, httpOptions); + delete options.proxy; // proxy isn't an HTTP option + delete options.timeout; // timeout isn't an HTTP option -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } + var stream = http.request(options, function (httpResp) { + if (stream.didCallback) return; - return this.compareMain(other) || this.comparePre(other) -} + callback(httpResp); + httpResp.emit( + 'headers', + httpResp.statusCode, + httpResp.headers, + httpResp.statusMessage + ); + }); + httpRequest.stream = stream; // attach stream to httpRequest + stream.didCallback = false; -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } + // connection timeout support + if (httpOptions.connectTimeout) { + var connectTimeoutId; + stream.on('socket', function(socket) { + if (socket.connecting) { + connectTimeoutId = setTimeout(function connectTimeout() { + if (stream.didCallback) return; stream.didCallback = true; - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} + stream.abort(); + errCallback(AWS.util.error( + new Error('Socket timed out without establishing a connection'), + {code: 'TimeoutError'} + )); + }, httpOptions.connectTimeout); + socket.on('connect', function() { + clearTimeout(connectTimeoutId); + connectTimeoutId = null; + }); + } + }); + } -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } + // timeout support + stream.setTimeout(httpOptions.timeout || 0, function() { + if (stream.didCallback) return; stream.didCallback = true; - // 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 msg = 'Connection timed out after ' + httpOptions.timeout + 'ms'; + errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'})); + stream.abort(); + }); - 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 + stream.on('error', function() { + if (connectTimeoutId) { + clearTimeout(connectTimeoutId); + connectTimeoutId = null; + } + if (stream.didCallback) return; stream.didCallback = true; + errCallback.apply(stream, arguments); + }); + + var expect = httpRequest.headers.Expect || httpRequest.headers.expect; + if (expect === '100-continue') { + stream.on('continue', function() { + self.writeBody(stream, httpRequest); + }); } else { - return compareIdentifiers(a, b) + this.writeBody(stream, httpRequest); } - } 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 + return stream; + }, - 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] + writeBody: function writeBody(stream, httpRequest) { + var body = httpRequest.body; + var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10); + + if (body instanceof Stream) { + // For progress support of streaming content - + // pipe the data through a transform stream to emit 'sendProgress' events + var progressStream = this.progressStream(stream, totalBytes); + if (progressStream) { + body.pipe(progressStream).pipe(stream); } 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) - } + body.pipe(stream); } - 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 if (body) { + // The provided body is a buffer/string and is already fully available in memory - + // For performance it's best to send it as a whole by calling stream.end(body), + // Callers expect a 'sendProgress' event which is best emitted once + // the http request stream has been fully written and all data flushed. + // The use of totalBytes is important over body.length for strings where + // length is char length and not byte length. + stream.once('finish', function() { + stream.emit('sendProgress', { + loaded: totalBytes, + total: totalBytes + }); + }); + stream.end(body); + } else { + // no request body + stream.end(); + } + }, + + /** + * Create the https.Agent or http.Agent according to the request schema. + */ + getAgent: function getAgent(useSSL, agentOptions) { + var http = useSSL ? __webpack_require__(7211) : __webpack_require__(8605); + if (useSSL) { + if (!AWS.NodeHttpClient.sslAgent) { + AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({ + rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true + }, agentOptions || {})); + AWS.NodeHttpClient.sslAgent.setMaxListeners(0); + + // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity. + // Users can bypass this default by supplying their own Agent as part of SDK configuration. + Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', { + enumerable: true, + get: function() { + var defaultMaxSockets = 50; + var globalAgent = http.globalAgent; + if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') { + return globalAgent.maxSockets; + } + return defaultMaxSockets; } - } else { - this.prerelease = [identifier, 0] - } + }); } - break + return AWS.NodeHttpClient.sslAgent; + } else { + if (!AWS.NodeHttpClient.agent) { + AWS.NodeHttpClient.agent = new http.Agent(agentOptions); + } + return AWS.NodeHttpClient.agent; + } + }, - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} + progressStream: function progressStream(stream, totalBytes) { + if (typeof TransformStream === 'undefined') { + // for node 0.8 there is no streaming progress + return; + } + var loadedBytes = 0; + var reporter = new TransformStream(); + reporter._transform = function(chunk, encoding, callback) { + if (chunk) { + loadedBytes += chunk.length; + stream.emit('sendProgress', { + loaded: loadedBytes, + total: totalBytes + }); + } + callback(null, chunk); + }; + return reporter; + }, + + emitter: null +}); + +/** + * @!ignore + */ + +/** + * @api private + */ +AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype; + +/** + * @api private + */ +AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1; -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 - } -} +/***/ 7495: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -exports.compareIdentifiers = compareIdentifiers +var util = __webpack_require__(7985); -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) +function JsonBuilder() { } - if (anum && bnum) { - a = +a - b = +b - } +JsonBuilder.prototype.build = function(value, shape) { + return JSON.stringify(translate(value, shape)); +}; - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} +function translate(value, shape) { + if (!shape || value === undefined || value === null) return undefined; -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) + switch (shape.type) { + case 'structure': return translateStructure(value, shape); + case 'map': return translateMap(value, shape); + case 'list': return translateList(value, shape); + default: return translateScalar(value, shape); + } } -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major +function translateStructure(structure, shape) { + var struct = {}; + util.each(structure, function(name, value) { + var memberShape = shape.members[name]; + if (memberShape) { + if (memberShape.location !== 'body') return; + var locationName = memberShape.isLocationName ? memberShape.name : name; + var result = translate(value, memberShape); + if (result !== undefined) struct[locationName] = result; + } + }); + return struct; } -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor +function translateList(list, shape) { + var out = []; + util.arrayEach(list, function(value) { + var result = translate(value, shape.member); + if (result !== undefined) out.push(result); + }); + return out; } -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch +function translateMap(map, shape) { + var out = {}; + util.each(map, function(key, value) { + var result = translate(value, shape.value); + if (result !== undefined) out[key] = result; + }); + return out; } -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) +function translateScalar(value, shape) { + return shape.toWireFormat(value); } -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} +/** + * @api private + */ +module.exports = JsonBuilder; -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) - }) -} +/***/ 5474: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} +var util = __webpack_require__(7985); -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 +function JsonParser() { } + +JsonParser.prototype.parse = function(value, shape) { + return translate(JSON.parse(value), shape); +}; + +function translate(value, shape) { + if (!shape || value === undefined) return undefined; + + switch (shape.type) { + case 'structure': return translateStructure(value, shape); + case 'map': return translateMap(value, shape); + case 'list': return translateList(value, shape); + default: return translateScalar(value, shape); + } } -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 +function translateStructure(structure, shape) { + if (structure == null) return undefined; + + var struct = {}; + var shapeMembers = shape.members; + util.each(shapeMembers, function(name, memberShape) { + var locationName = memberShape.isLocationName ? memberShape.name : name; + if (Object.prototype.hasOwnProperty.call(structure, locationName)) { + var value = structure[locationName]; + var result = translate(value, memberShape); + if (result !== undefined) struct[name] = result; + } + }); + return struct; } -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 +function translateList(list, shape) { + if (list == null) return undefined; + + var out = []; + util.arrayEach(list, function(value) { + var result = translate(value, shape.member); + if (result === undefined) out.push(null); + else out.push(result); + }); + return out; } -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 +function translateMap(map, shape) { + if (map == null) return undefined; + + var out = {}; + util.each(map, function(key, value) { + var result = translate(value, shape.value); + if (result === undefined) out[key] = null; + else out[key] = result; + }); + return out; } -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 +function translateScalar(value, shape) { + return shape.toType(value); } -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 +/** + * @api private + */ +module.exports = JsonParser; - 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) +/***/ 5768: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - case '>': - return gt(a, b, loose) +var AWS = __webpack_require__(8437); +__webpack_require__(1556); +var inherit = AWS.util.inherit; - case '>=': - return gte(a, b, loose) +/** + * Represents a metadata service available on EC2 instances. Using the + * {request} method, you can receieve metadata about any available resource + * on the metadata service. + * + * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED + * environment variable to a truthy value. + * + * @!attribute [r] httpOptions + * @return [map] a map of options to pass to the underlying HTTP request: + * + * * **timeout** (Number) — a timeout value in milliseconds to wait + * before aborting the connection. Set to 0 for no timeout. + * + * @!macro nobrowser + */ +AWS.MetadataService = inherit({ + /** + * @return [String] the hostname of the instance metadata service + */ + host: '169.254.169.254', - case '<': - return lt(a, b, loose) + /** + * @!ignore + */ - case '<=': - return lte(a, b, loose) + /** + * Default HTTP options. By default, the metadata service is set to not + * timeout on long requests. This means that on non-EC2 machines, this + * request will never return. If you are calling this operation from an + * environment that may not always run on EC2, set a `timeout` value so + * the SDK will abort the request after a given number of milliseconds. + */ + httpOptions: { timeout: 0 }, - default: - throw new TypeError('Invalid operator: ' + op) - } -} + /** + * when enabled, metadata service will not fetch token + */ + disableFetchToken: false, -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + /** + * Creates a new MetadataService object with a given set of options. + * + * @option options host [String] the hostname of the instance metadata + * service + * @option options httpOptions [map] a map of options to pass to the + * underlying HTTP request: + * + * * **timeout** (Number) — a timeout value in milliseconds to wait + * before aborting the connection. Set to 0 for no timeout. + * @option options maxRetries [Integer] the maximum number of retries to + * perform for timeout errors + * @option options retryDelayOptions [map] A set of options to configure the + * retry delay on retryable errors. See AWS.Config for details. + */ + constructor: function MetadataService(options) { + AWS.util.update(this, options); + }, + + /** + * Sends a request to the instance metadata service for a given resource. + * + * @param path [String] the path of the resource to get + * + * @param options [map] an optional map used to make request + * + * * **method** (String) — HTTP request method + * + * * **headers** (map) — a map of response header keys and their respective values + * + * @callback callback function(err, data) + * Called when a response is available from the service. + * @param err [Error, null] if an error occurred, this value will be set + * @param data [String, null] if the request was successful, the body of + * the response + */ + request: function request(path, options, callback) { + if (arguments.length === 2) { + callback = options; + options = {}; } - } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp + if (process.env[AWS.util.imdsDisabledEnv]) { + callback(new Error('EC2 Instance Metadata Service access disabled')); + return; + } + + path = path || '/'; + var httpRequest = new AWS.HttpRequest('http://' + this.host + path); + httpRequest.method = options.method || 'GET'; + if (options.headers) { + httpRequest.headers = options.headers; + } + AWS.util.handleRequestWithRetries(httpRequest, this, callback); + }, + + /** + * @api private + */ + loadCredentialsCallbacks: [], + + /** + * Fetches metadata token used for getting credentials + * + * @api private + * @callback callback function(err, token) + * Called when token is loaded from the resource + */ + fetchMetadataToken: function fetchMetadataToken(callback) { + var self = this; + var tokenFetchPath = '/latest/api/token'; + self.request( + tokenFetchPath, + { + 'method': 'PUT', + 'headers': { + 'x-aws-ec2-metadata-token-ttl-seconds': '21600' + } + }, + callback + ); + }, + + /** + * Fetches credentials + * + * @api private + * @callback cb function(err, creds) + * Called when credentials are loaded from the resource + */ + fetchCredentials: function fetchCredentials(options, cb) { + var self = this; + var basePath = '/latest/meta-data/iam/security-credentials/'; + + self.request(basePath, options, function (err, roleName) { + if (err) { + self.disableFetchToken = !(err.statusCode === 401); + cb(AWS.util.error( + err, + { + message: 'EC2 Metadata roleName request returned error' + } + )); + return; + } + roleName = roleName.split('\n')[0]; // grab first (and only) role + self.request(basePath + roleName, options, function (credErr, credData) { + if (credErr) { + self.disableFetchToken = !(credErr.statusCode === 401); + cb(AWS.util.error( + credErr, + { + message: 'EC2 Metadata creds request returned error' + } + )); + return; + } + try { + var credentials = JSON.parse(credData); + cb(null, credentials); + } catch (parseError) { + cb(parseError); + } + }); + }); + }, + + /** + * Loads a set of credentials stored in the instance metadata service + * + * @api private + * @callback callback function(err, credentials) + * Called when credentials are loaded from the resource + * @param err [Error] if an error occurred, this value will be set + * @param credentials [Object] the raw JSON object containing all + * metadata from the credentials resource + */ + loadCredentials: function loadCredentials(callback) { + var self = this; + self.loadCredentialsCallbacks.push(callback); + if (self.loadCredentialsCallbacks.length > 1) { return; } + + function callbacks(err, creds) { + var cb; + while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) { + cb(err, creds); + } + } + + if (self.disableFetchToken) { + self.fetchCredentials({}, callbacks); } else { - comp = comp.value + self.fetchMetadataToken(function(tokenError, token) { + if (tokenError) { + if (tokenError.code === 'TimeoutError') { + self.disableFetchToken = true; + } else if (tokenError.retryable === true) { + callbacks(AWS.util.error( + tokenError, + { + message: 'EC2 Metadata token request returned error' + } + )); + return; + } else if (tokenError.statusCode === 400) { + callbacks(AWS.util.error( + tokenError, + { + message: 'EC2 Metadata token request returned 400' + } + )); + return; + } + } + var options = {}; + if (token) { + options.headers = { + 'x-aws-ec2-metadata-token': token + }; + } + self.fetchCredentials(options, callbacks); + }); + } } +}); + +/** + * @api private + */ +module.exports = AWS.MetadataService; + + +/***/ }), + +/***/ 7657: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Collection = __webpack_require__(1965); +var Operation = __webpack_require__(8083); +var Shape = __webpack_require__(1349); +var Paginator = __webpack_require__(5938); +var ResourceWaiter = __webpack_require__(1368); +var metadata = __webpack_require__(9497); + +var util = __webpack_require__(7985); +var property = util.property; +var memoizedProperty = util.memoizedProperty; + +function Api(api, options) { + var self = this; + api = api || {}; + options = options || {}; + options.api = this; + + api.metadata = api.metadata || {}; + + var serviceIdentifier = options.serviceIdentifier; + delete options.serviceIdentifier; + + property(this, 'isApi', true, false); + property(this, 'apiVersion', api.metadata.apiVersion); + property(this, 'endpointPrefix', api.metadata.endpointPrefix); + property(this, 'signingName', api.metadata.signingName); + property(this, 'globalEndpoint', api.metadata.globalEndpoint); + property(this, 'signatureVersion', api.metadata.signatureVersion); + property(this, 'jsonVersion', api.metadata.jsonVersion); + property(this, 'targetPrefix', api.metadata.targetPrefix); + property(this, 'protocol', api.metadata.protocol); + property(this, 'timestampFormat', api.metadata.timestampFormat); + property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace); + property(this, 'abbreviation', api.metadata.serviceAbbreviation); + property(this, 'fullName', api.metadata.serviceFullName); + property(this, 'serviceId', api.metadata.serviceId); + if (serviceIdentifier && metadata[serviceIdentifier]) { + property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); + } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } + memoizedProperty(this, 'className', function() { + var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName; + if (!name) return null; - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) + name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, ''); + if (name === 'ElasticLoadBalancing') name = 'ELB'; + return name; + }); - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version + function addEndpointOperation(name, operation) { + if (operation.endpointoperation === true) { + property(self, 'endpointOperation', util.string.lowerFirst(name)); + } + if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) { + property( + self, + 'hasRequiredEndpointDiscovery', + operation.endpointdiscovery.required === true + ); + } } - debug('comp', this) -} + property(this, 'operations', new Collection(api.operations, options, function(name, operation) { + return new Operation(name, operation, options); + }, util.string.lowerFirst, addEndpointOperation)); -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] - var m = comp.match(r) + property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) { + return Shape.create(shape, options); + })); - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } + property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) { + return new Paginator(name, paginator, options); + })); - this.operator = m[1] - if (this.operator === '=') { - this.operator = '' - } + property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) { + return new ResourceWaiter(name, waiter, options); + }, util.string.lowerFirst)); - // 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) + if (options.documentation) { + property(this, 'documentation', api.documentation); + property(this, 'documentationUrl', api.documentationUrl); } } -Comparator.prototype.toString = function () { - return this.value -} +/** + * @api private + */ +module.exports = Api; -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) - } +/***/ 1965: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - return cmp(version, this.operator, this.semver, this.options) +var memoizedProperty = __webpack_require__(7985).memoizedProperty; + +function memoize(name, value, factory, nameTr) { + memoizedProperty(this, nameTr(name), function() { + return factory(name, value); + }); } -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +function Collection(iterable, options, factory, nameTr, callback) { + nameTr = nameTr || String; + var self = this; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + for (var id in iterable) { + if (Object.prototype.hasOwnProperty.call(iterable, id)) { + memoize.call(self, id, iterable[id], factory, nameTr); + if (callback) callback(id, iterable[id]); } } - - 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 - } - } +/** + * @api private + */ +module.exports = Collection; - 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) - } +/***/ 8083: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +var Shape = __webpack_require__(1349); - // 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 - }) +var util = __webpack_require__(7985); +var property = util.property; +var memoizedProperty = util.memoizedProperty; - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } +function Operation(name, operation, options) { + var self = this; + options = options || {}; - this.format() -} + property(this, 'name', operation.name || name); + property(this, 'api', options.api, false); -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} + operation.http = operation.http || {}; + property(this, 'endpoint', operation.endpoint); + property(this, 'httpMethod', operation.http.method || 'POST'); + property(this, 'httpPath', operation.http.requestUri || '/'); + property(this, 'authtype', operation.authtype || ''); + property( + this, + 'endpointDiscoveryRequired', + operation.endpointdiscovery ? + (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') : + 'NULL' + ); -Range.prototype.toString = function () { - return this.range -} + memoizedProperty(this, 'input', function() { + if (!operation.input) { + return new Shape.create({type: 'structure'}, options); + } + return Shape.create(operation.input, options); + }); -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]) + memoizedProperty(this, 'output', function() { + if (!operation.output) { + return new Shape.create({type: 'structure'}, options); + } + return Shape.create(operation.output, options); + }); - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) + memoizedProperty(this, 'errors', function() { + var list = []; + if (!operation.errors) return null; - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) + for (var i = 0; i < operation.errors.length; i++) { + list.push(Shape.create(operation.errors[i], options)); + } - // normalize spaces - range = range.split(/\s+/).join(' ') + return list; + }); - // At this point, the range is completely trimmed and - // ready to be split into comparators. + memoizedProperty(this, 'paginator', function() { + return options.api.paginators[name]; + }); - 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) - }) + if (options.documentation) { + property(this, 'documentation', operation.documentation); + property(this, 'documentationUrl', operation.documentationUrl); } - 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') - } + // idempotentMembers only tracks top-level input shapes + memoizedProperty(this, 'idempotentMembers', function() { + var idempotentMembers = []; + var input = self.input; + var members = input.members; + if (!input.members) { + return idempotentMembers; + } + for (var name in members) { + if (!members.hasOwnProperty(name)) { + continue; + } + if (members[name].isIdempotent === true) { + idempotentMembers.push(name); + } + } + return idempotentMembers; + }); - 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) - }) - }) - }) - }) + memoizedProperty(this, 'hasEventOutput', function() { + var output = self.output; + return hasEventStream(output); + }); } -// 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(' ') - }) -} +function hasEventStream(topLevelShape) { + var members = topLevelShape.members; + var payload = topLevelShape.payload; -// 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 -} + if (!topLevelShape.members) { + return false; + } -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} + if (payload) { + var payloadMember = members[payload]; + return payloadMember.isEventStream; + } -// ~, ~> --> * (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(' ') + // check if any member is an event stream + for (var name in members) { + if (!members.hasOwnProperty(name)) { + if (members[name].isEventStream === true) { + return true; + } + } + } + return false; } -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' - } +/** + * @api private + */ +module.exports = Operation; - 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 +/***/ 5938: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - 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 property = __webpack_require__(7985).property; - debug('caret return', ret) - return ret - }) +function Paginator(name, paginator) { + property(this, 'inputToken', paginator.input_token); + property(this, 'limitKey', paginator.limit_key); + property(this, 'moreResults', paginator.more_results); + property(this, 'outputToken', paginator.output_token); + property(this, 'resultKey', paginator.result_key); } -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} +/** + * @api private + */ +module.exports = Paginator; -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 +/***/ 1368: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - 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 util = __webpack_require__(7985); +var property = util.property; - 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' +function ResourceWaiter(name, waiter, options) { + options = options || {}; + property(this, 'name', name); + property(this, 'api', options.api, false); + + if (waiter.operation) { + property(this, 'operation', util.string.lowerFirst(waiter.operation)); + } + + var self = this; + var keys = [ + 'type', + 'description', + 'delay', + 'maxAttempts', + 'acceptors' + ]; + + keys.forEach(function(key) { + var value = waiter[key]; + if (value) { + property(self, key, value); } + }); +} - debug('xRange return', ret) +/** + * @api private + */ +module.exports = ResourceWaiter; - return ret - }) + +/***/ }), + +/***/ 1349: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Collection = __webpack_require__(1965); + +var util = __webpack_require__(7985); + +function property(obj, name, value) { + if (value !== null && value !== undefined) { + util.property.apply(this, arguments); + } } -// 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], '') +function memoizedProperty(obj, name) { + if (!obj.constructor.prototype[name]) { + util.memoizedProperty.apply(this, arguments); + } } -// 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 +function Shape(shape, options, memberName) { + options = options || {}; + + property(this, 'shape', shape.shape); + property(this, 'api', options.api, false); + property(this, 'type', shape.type); + property(this, 'enum', shape.enum); + property(this, 'min', shape.min); + property(this, 'max', shape.max); + property(this, 'pattern', shape.pattern); + property(this, 'location', shape.location || this.location || 'body'); + property(this, 'name', this.name || shape.xmlName || shape.queryName || + shape.locationName || memberName); + property(this, 'isStreaming', shape.streaming || this.isStreaming || false); + property(this, 'requiresLength', shape.requiresLength, false); + property(this, 'isComposite', shape.isComposite || false); + property(this, 'isShape', true, false); + property(this, 'isQueryName', Boolean(shape.queryName), false); + property(this, 'isLocationName', Boolean(shape.locationName), false); + property(this, 'isIdempotent', shape.idempotencyToken === true); + property(this, 'isJsonValue', shape.jsonvalue === true); + property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true); + property(this, 'isEventStream', Boolean(shape.eventstream), false); + property(this, 'isEvent', Boolean(shape.event), false); + property(this, 'isEventPayload', Boolean(shape.eventpayload), false); + property(this, 'isEventHeader', Boolean(shape.eventheader), false); + property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false); + property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false); + property(this, 'hostLabel', Boolean(shape.hostLabel), false); + + if (options.documentation) { + property(this, 'documentation', shape.documentation); + property(this, 'documentationUrl', shape.documentationUrl); } - 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 + if (shape.xmlAttribute) { + property(this, 'isXmlAttribute', shape.xmlAttribute || false); } - return (from + ' ' + to).trim() + // type conversion and parsing + property(this, 'defaultValue', null); + this.toWireFormat = function(value) { + if (value === null || value === undefined) return ''; + return value; + }; + this.toType = function(value) { return value; }; } -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } +/** + * @api private + */ +Shape.normalizedTypes = { + character: 'string', + double: 'float', + long: 'integer', + short: 'integer', + biginteger: 'integer', + bigdecimal: 'float', + blob: 'binary' +}; - if (typeof version === 'string') { - version = new SemVer(version, this.options) - } +/** + * @api private + */ +Shape.types = { + 'structure': StructureShape, + 'list': ListShape, + 'map': MapShape, + 'boolean': BooleanShape, + 'timestamp': TimestampShape, + 'float': FloatShape, + 'integer': IntegerShape, + 'string': StringShape, + 'base64': Base64Shape, + 'binary': BinaryShape +}; - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true +Shape.resolve = function resolve(shape, options) { + if (shape.shape) { + var refShape = options.api.shapes[shape.shape]; + if (!refShape) { + throw new Error('Cannot find shape reference: ' + shape.shape); } + + return refShape; + } else { + return null; } - return false -} +}; -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false +Shape.create = function create(shape, options, memberName) { + if (shape.isShape) return shape; + + var refShape = Shape.resolve(shape, options); + if (refShape) { + var filteredKeys = Object.keys(shape); + if (!options.documentation) { + filteredKeys = filteredKeys.filter(function(name) { + return !name.match(/documentation/); + }); } - } - 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 - } + // create an inline shape with extra members + var InlineShape = function() { + refShape.constructor.call(this, shape, options, memberName); + }; + InlineShape.prototype = refShape; + return new InlineShape(); + } else { + // set type if not set + if (!shape.type) { + if (shape.members) shape.type = 'structure'; + else if (shape.member) shape.type = 'list'; + else if (shape.key) shape.type = 'map'; + else shape.type = 'string'; + } - 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 - } - } + // normalize types + var origType = shape.type; + if (Shape.normalizedTypes[shape.type]) { + shape.type = Shape.normalizedTypes[shape.type]; } - // Version has a -pre, but it's not one of the ones we like. - return false + if (Shape.types[shape.type]) { + return new Shape.types[shape.type](shape, options, memberName); + } else { + throw new Error('Unrecognized shape type: ' + origType); + } } +}; - return true -} +function CompositeShape(shape) { + Shape.apply(this, arguments); + property(this, 'isComposite', true); -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false + if (shape.flattened) { + property(this, 'flattened', shape.flattened || 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 +function StructureShape(shape, options) { + var self = this; + var requiredMap = null, firstInit = !this.isShape; + + CompositeShape.apply(this, arguments); + + if (firstInit) { + property(this, 'defaultValue', function() { return {}; }); + property(this, 'members', {}); + property(this, 'memberNames', []); + property(this, 'required', []); + property(this, 'isRequired', function() { return false; }); } - 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 + if (shape.members) { + property(this, 'members', new Collection(shape.members, options, function(name, member) { + return Shape.create(member, options, name); + })); + memoizedProperty(this, 'memberNames', function() { + return shape.xmlOrder || Object.keys(shape.members); + }); + + if (shape.event) { + memoizedProperty(this, 'eventPayloadMemberName', function() { + var members = self.members; + var memberNames = self.memberNames; + // iterate over members to find ones that are event payloads + for (var i = 0, iLen = memberNames.length; i < iLen; i++) { + if (members[memberNames[i]].isEventPayload) { + return memberNames[i]; + } + } + }); + + memoizedProperty(this, 'eventHeaderMemberNames', function() { + var members = self.members; + var memberNames = self.memberNames; + var eventHeaderMemberNames = []; + // iterate over members to find ones that are event headers + for (var i = 0, iLen = memberNames.length; i < iLen; i++) { + if (members[memberNames[i]].isEventHeader) { + eventHeaderMemberNames.push(memberNames[i]); + } + } + return eventHeaderMemberNames; + }); + } } - 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) + + if (shape.required) { + property(this, 'required', shape.required); + property(this, 'isRequired', function(name) { + if (!requiredMap) { + requiredMap = {}; + for (var i = 0; i < shape.required.length; i++) { + requiredMap[shape.required[i]] = true; + } } - } - }) - return min -} -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) + return requiredMap[name]; + }, false, true); + } - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver + property(this, 'resultWrapper', shape.resultWrapper || null); + + if (shape.payload) { + property(this, 'payload', shape.payload); } - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver + if (typeof shape.xmlNamespace === 'string') { + property(this, 'xmlNamespaceUri', shape.xmlNamespace); + } else if (typeof shape.xmlNamespace === 'object') { + property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix); + property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri); } +} - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +function ListShape(shape, options) { + var self = this, firstInit = !this.isShape; + CompositeShape.apply(this, arguments); - 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 (firstInit) { + property(this, 'defaultValue', function() { return []; }); } - if (minver && range.test(minver)) { - return minver + if (shape.member) { + memoizedProperty(this, 'member', function() { + return Shape.create(shape.member, options); + }); } - return null + if (this.flattened) { + var oldName = this.name; + memoizedProperty(this, 'name', function() { + return self.member.name || oldName; + }); + } } -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 +function MapShape(shape, options) { + var firstInit = !this.isShape; + CompositeShape.apply(this, arguments); + + if (firstInit) { + property(this, 'defaultValue', function() { return {}; }); + property(this, 'key', Shape.create({type: 'string'}, options)); + property(this, 'value', Shape.create({type: 'string'}, options)); } -} -// 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) + if (shape.key) { + memoizedProperty(this, 'key', function() { + return Shape.create(shape.key, options); + }); + } + if (shape.value) { + memoizedProperty(this, 'value', function() { + return Shape.create(shape.value, 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) +function TimestampShape(shape) { + var self = this; + Shape.apply(this, arguments); + + if (shape.timestampFormat) { + property(this, 'timestampFormat', shape.timestampFormat); + } else if (self.isTimestampFormatSet && this.timestampFormat) { + property(this, 'timestampFormat', this.timestampFormat); + } else if (this.location === 'header') { + property(this, 'timestampFormat', 'rfc822'); + } else if (this.location === 'querystring') { + property(this, 'timestampFormat', 'iso8601'); + } else if (this.api) { + switch (this.api.protocol) { + case 'json': + case 'rest-json': + property(this, 'timestampFormat', 'unixTimestamp'); + break; + case 'rest-xml': + case 'query': + case 'ec2': + property(this, 'timestampFormat', 'iso8601'); + break; + } + } + + this.toType = function(value) { + if (value === null || value === undefined) return null; + if (typeof value.toUTCString === 'function') return value; + return typeof value === 'string' || typeof value === 'number' ? + util.date.parseTimestamp(value) : null; + }; + + this.toWireFormat = function(value) { + return util.date.format(value, self.timestampFormat); + }; } -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) +function StringShape() { + Shape.apply(this, arguments); - 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 ">"') - } + var nullLessProtocols = ['rest-xml', 'query', 'ec2']; + this.toType = function(value) { + value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? + value || '' : value; + if (this.isJsonValue) { + return JSON.parse(value); + } - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } + return value && typeof value.toString === 'function' ? + value.toString() : value; + }; - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. + this.toWireFormat = function(value) { + return this.isJsonValue ? JSON.stringify(value) : value; + }; +} - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +function FloatShape() { + Shape.apply(this, arguments); - var high = null - var low = null + this.toType = function(value) { + if (value === null || value === undefined) return null; + return parseFloat(value); + }; + this.toWireFormat = this.toType; +} - 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 - } - }) +function IntegerShape() { + Shape.apply(this, arguments); - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } + this.toType = function(value) { + if (value === null || value === undefined) return null; + return parseInt(value, 10); + }; + this.toWireFormat = this.toType; +} - // 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 +function BinaryShape() { + Shape.apply(this, arguments); + this.toType = function(value) { + var buf = util.base64.decode(value); + if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') { + /* Node.js can create a Buffer that is not isolated. + * i.e. buf.byteLength !== buf.buffer.byteLength + * This means that the sensitive data is accessible to anyone with access to buf.buffer. + * If this is the node shared Buffer, then other code within this process _could_ find this secret. + * Copy sensitive data to an isolated Buffer and zero the sensitive data. + * While this is safe to do here, copying this code somewhere else may produce unexpected results. + */ + var secureBuf = util.Buffer.alloc(buf.length, buf); + buf.fill(0); + buf = secureBuf; } - } - return true + return buf; + }; + this.toWireFormat = util.base64.encode; } -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +function Base64Shape() { + BinaryShape.apply(this, arguments); } -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) +function BooleanShape() { + Shape.apply(this, arguments); + + this.toType = function(value) { + if (typeof value === 'boolean') return value; + if (value === null || value === undefined) return null; + return value === 'true'; + }; } -exports.coerce = coerce -function coerce (version) { - if (version instanceof SemVer) { - return version - } +/** + * @api private + */ +Shape.shapes = { + StructureShape: StructureShape, + ListShape: ListShape, + MapShape: MapShape, + StringShape: StringShape, + BooleanShape: BooleanShape, + Base64Shape: Base64Shape +}; - if (typeof version !== 'string') { - return null - } +/** + * @api private + */ +module.exports = Shape; - var match = version.match(re[COERCE]) - if (match == null) { - return null - } +/***/ }), - return parse(match[1] + - '.' + (match[2] || '0') + - '.' + (match[3] || '0')) -} +/***/ 3639: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var util = __webpack_require__(7985); -/***/ }), -/* 281 */, -/* 282 */, -/* 283 */, -/* 284 */, -/* 285 */, -/* 286 */, -/* 287 */, -/* 288 */, -/* 289 */, -/* 290 */, -/* 291 */, -/* 292 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +util.isBrowser = function() { return false; }; +util.isNode = function() { return true; }; -;(function (sax) { // wrapper for non-node envs - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream +// node.js specific modules +util.crypto.lib = __webpack_require__(6417); +util.Buffer = __webpack_require__(4293).Buffer; +util.domain = __webpack_require__(5229); +util.stream = __webpack_require__(2413); +util.url = __webpack_require__(8835); +util.querystring = __webpack_require__(1191); +util.environment = 'nodejs'; +util.createEventStream = util.stream.Readable ? + __webpack_require__(9643).createEventStream : __webpack_require__(3727).createEventStream; +util.realClock = __webpack_require__(1370); +util.clientSideMonitoring = { + Publisher: __webpack_require__(6807).Publisher, + configProvider: __webpack_require__(1822), +}; +util.iniLoader = __webpack_require__(9697)/* .iniLoader */ .b; +util.getSystemErrorName = __webpack_require__(1669).getSystemErrorName; - // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. - // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), - // since that's the earliest that a buffer overrun could occur. This way, checks are - // as rare as required, but as often as necessary to ensure never crossing this bound. - // Furthermore, buffers are only tested at most once per write(), so passing a very - // large string into write() might have undesirable effects, but this is manageable by - // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme - // edge case, result in creating at most one complete copy of the string passed in. - // Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 +var AWS; - var buffers = [ - 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', - 'procInstName', 'procInstBody', 'entity', 'attribName', - 'attribValue', 'cdata', 'script' - ] +/** + * @api private + */ +module.exports = AWS = __webpack_require__(8437); - sax.EVENTS = [ - 'text', - 'processinginstruction', - 'sgmldeclaration', - 'doctype', - 'comment', - 'opentagstart', - 'attribute', - 'opentag', - 'closetag', - 'opencdata', - 'cdata', - 'closecdata', - 'error', - 'end', - 'ready', - 'script', - 'opennamespace', - 'closenamespace' - ] +__webpack_require__(3819); +__webpack_require__(6965); +__webpack_require__(7360); +__webpack_require__(7083); +__webpack_require__(4998); +__webpack_require__(3498); +__webpack_require__(5037); +__webpack_require__(371); - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) { - return new SAXParser(strict, opt) - } +// Load the xml2js XML parser +AWS.XML.Parser = __webpack_require__(6752); - var parser = this - clearBuffers(parser) - parser.q = parser.c = '' - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.strictEntities = parser.opt.strictEntities - parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) - parser.attribList = [] +// Load Node HTTP client +__webpack_require__(2310); - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) { - parser.ns = Object.create(rootNS) - } +__webpack_require__(5417); - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, 'onready') - } +// Load custom credential providers +__webpack_require__(1017); +__webpack_require__(3379); +__webpack_require__(8764); +__webpack_require__(645); +__webpack_require__(7714); +__webpack_require__(7454); +__webpack_require__(3754); +__webpack_require__(371); - if (!Object.create) { - Object.create = function (o) { - function F () {} - F.prototype = o - var newf = new F() - return newf - } - } +// Setup default chain providers +// If this changes, please update documentation for +// AWS.CredentialProviderChain.defaultProviders in +// credentials/credential_provider_chain.js +AWS.CredentialProviderChain.defaultProviders = [ + function () { return new AWS.EnvironmentCredentials('AWS'); }, + function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + function () { return new AWS.SharedIniFileCredentials(); }, + function () { return new AWS.ECSCredentials(); }, + function () { return new AWS.ProcessCredentials(); }, + function () { return new AWS.TokenFileWebIdentityCredentials(); }, + function () { return new AWS.EC2MetadataCredentials(); } +]; - if (!Object.keys) { - Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a +// Update configuration keys +AWS.util.update(AWS.Config.prototype.keys, { + credentials: function () { + var credentials = null; + new AWS.CredentialProviderChain([ + function () { return new AWS.EnvironmentCredentials('AWS'); }, + function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } + ]).resolve(function(err, creds) { + if (!err) credentials = creds; + }); + return credentials; + }, + credentialProvider: function() { + return new AWS.CredentialProviderChain(); + }, + logger: function () { + return process.env.AWSJS_DEBUG ? console : null; + }, + region: function() { + var env = process.env; + var region = env.AWS_REGION || env.AMAZON_REGION; + if (env[AWS.util.configOptInEnv]) { + var toCheck = [ + {filename: env[AWS.util.sharedCredentialsFileEnv]}, + {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} + ]; + var iniLoader = AWS.util.iniLoader; + while (!region && toCheck.length) { + var configFile = iniLoader.loadFrom(toCheck.shift()); + var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; + region = profile && profile.region; + } } + return region; } +}); - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - var maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case 'textNode': - closeText(parser) - break +// Reset configuration +AWS.config = new AWS.Config(); - case 'cdata': - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - break - case 'script': - emitNode(parser, 'onscript', parser.script) - parser.script = '' - break +/***/ }), - default: - error(parser, 'Max buffer length exceeded: ' + buffers[i]) - } - } - maxActual = Math.max(maxActual, len) - } - // schedule the next check for the earliest possible buffer overrun. - var m = sax.MAX_BUFFER_LENGTH - maxActual - parser.bufferCheckPosition = m + parser.position - } +/***/ 9127: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i++) { - parser[buffers[i]] = '' - } - } +var AWS = __webpack_require__(8437); - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== '') { - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - } - if (parser.script !== '') { - emitNode(parser, 'onscript', parser.script) - parser.script = '' +/** + * @api private + */ +AWS.ParamValidator = AWS.util.inherit({ + /** + * Create a new validator object. + * + * @param validation [Boolean|map] whether input parameters should be + * validated against the operation description before sending the + * request. Pass a map to enable any of the following specific + * validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. + */ + constructor: function ParamValidator(validation) { + if (validation === true || validation === undefined) { + validation = {'min': true}; } - } + this.validation = validation; + }, - SAXParser.prototype = { - end: function () { end(this) }, - write: write, - resume: function () { this.error = null; return this }, - close: function () { return this.write(null) }, - flush: function () { flushBuffers(this) } - } + validate: function validate(shape, params, context) { + this.errors = []; + this.validateMember(shape, params || {}, context || 'params'); - var Stream - try { - Stream = __webpack_require__(413).Stream - } catch (ex) { - Stream = function () {} - } + if (this.errors.length > 1) { + var msg = this.errors.join('\n* '); + msg = 'There were ' + this.errors.length + + ' validation errors:\n* ' + msg; + throw AWS.util.error(new Error(msg), + {code: 'MultipleValidationErrors', errors: this.errors}); + } else if (this.errors.length === 1) { + throw this.errors[0]; + } else { + return true; + } + }, - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== 'error' && ev !== 'end' - }) + fail: function fail(code, message) { + this.errors.push(AWS.util.error(new Error(message), {code: code})); + }, - function createStream (strict, opt) { - return new SAXStream(strict, opt) - } + validateStructure: function validateStructure(shape, params, context) { + this.validateType(params, context, ['object'], 'structure'); - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) { - return new SAXStream(strict, opt) + var paramName; + for (var i = 0; shape.required && i < shape.required.length; i++) { + paramName = shape.required[i]; + var value = params[paramName]; + if (value === undefined || value === null) { + this.fail('MissingRequiredParameter', + 'Missing required key \'' + paramName + '\' in ' + context); + } } - Stream.apply(this) - - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true + // validate hash members + for (paramName in params) { + if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue; - var me = this + var paramValue = params[paramName], + memberShape = shape.members[paramName]; - this._parser.onend = function () { - me.emit('end') + if (memberShape !== undefined) { + var memberContext = [context, paramName].join('.'); + this.validateMember(memberShape, paramValue, memberContext); + } else { + this.fail('UnexpectedParameter', + 'Unexpected key \'' + paramName + '\' found in ' + context); + } } - this._parser.onerror = function (er) { - me.emit('error', er) + return true; + }, - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null + validateMember: function validateMember(shape, param, context) { + switch (shape.type) { + case 'structure': + return this.validateStructure(shape, param, context); + case 'list': + return this.validateList(shape, param, context); + case 'map': + return this.validateMap(shape, param, context); + default: + return this.validateScalar(shape, param, context); } + }, - this._decoder = null + validateList: function validateList(shape, params, context) { + if (this.validateType(params, context, [Array])) { + this.validateRange(shape, params.length, context, 'list member count'); + // validate array members + for (var i = 0; i < params.length; i++) { + this.validateMember(shape.member, params[i], context + '[' + i + ']'); + } + } + }, - streamWraps.forEach(function (ev) { - Object.defineProperty(me, 'on' + ev, { - get: function () { - return me._parser['on' + ev] - }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - me._parser['on' + ev] = h - return h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) - } + validateMap: function validateMap(shape, params, context) { + if (this.validateType(params, context, ['object'], 'map')) { + // Build up a count of map members to validate range traits. + var mapCount = 0; + for (var param in params) { + if (!Object.prototype.hasOwnProperty.call(params, param)) continue; + // Validate any map key trait constraints + this.validateMember(shape.key, param, + context + '[key=\'' + param + '\']'); + this.validateMember(shape.value, params[param], + context + '[\'' + param + '\']'); + mapCount++; + } + this.validateRange(shape, mapCount, context, 'map member count'); + } + }, + + validateScalar: function validateScalar(shape, value, context) { + switch (shape.type) { + case null: + case undefined: + case 'string': + return this.validateString(shape, value, context); + case 'base64': + case 'binary': + return this.validatePayload(value, context); + case 'integer': + case 'float': + return this.validateNumber(shape, value, context); + case 'boolean': + return this.validateType(value, context, ['boolean']); + case 'timestamp': + return this.validateType(value, context, [Date, + /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'], + 'Date object, ISO-8601 string, or a UNIX timestamp'); + default: + return this.fail('UnkownType', 'Unhandled type ' + + shape.type + ' for ' + context); + } + }, - SAXStream.prototype = Object.create(Stream.prototype, { - constructor: { - value: SAXStream + validateString: function validateString(shape, value, context) { + var validTypes = ['string']; + if (shape.isJsonValue) { + validTypes = validTypes.concat(['number', 'object', 'boolean']); } - }) + if (value !== null && this.validateType(value, context, validTypes)) { + this.validateEnum(shape, value, context); + this.validateRange(shape, value.length, context, 'string length'); + this.validatePattern(shape, value, context); + this.validateUri(shape, value, context); + } + }, - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = __webpack_require__(304).StringDecoder - this._decoder = new SD('utf8') + validateUri: function validateUri(shape, value, context) { + if (shape['location'] === 'uri') { + if (value.length === 0) { + this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,' + + ' but found "' + value +'" for ' + context); } - data = this._decoder.write(data) } + }, - this._parser.write(data.toString()) - this.emit('data', data) - return true - } + validatePattern: function validatePattern(shape, value, context) { + if (this.validation['pattern'] && shape['pattern'] !== undefined) { + if (!(new RegExp(shape['pattern'])).test(value)) { + this.fail('PatternMatchError', 'Provided value "' + value + '" ' + + 'does not match regex pattern /' + shape['pattern'] + '/ for ' + + context); + } + } + }, - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) { - this.write(chunk) + validateRange: function validateRange(shape, value, context, descriptor) { + if (this.validation['min']) { + if (shape['min'] !== undefined && value < shape['min']) { + this.fail('MinRangeError', 'Expected ' + descriptor + ' >= ' + + shape['min'] + ', but found ' + value + ' for ' + context); + } } - this._parser.end() - return true - } + if (this.validation['max']) { + if (shape['max'] !== undefined && value > shape['max']) { + this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= ' + + shape['max'] + ', but found ' + value + ' for ' + context); + } + } + }, - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { - me._parser['on' + ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) + validateEnum: function validateRange(shape, value, context) { + if (this.validation['enum'] && shape['enum'] !== undefined) { + // Fail if the string value is not present in the enum list + if (shape['enum'].indexOf(value) === -1) { + this.fail('EnumError', 'Found string value of ' + value + ', but ' + + 'expected ' + shape['enum'].join('|') + ' for ' + context); } } + }, - return Stream.prototype.on.call(me, ev, handler) - } + validateType: function validateType(value, context, acceptedTypes, type) { + // We will not log an error for null or undefined, but we will return + // false so that callers know that the expected type was not strictly met. + if (value === null || value === undefined) return false; - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - var CDATA = '[CDATA[' - var DOCTYPE = 'DOCTYPE' - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' - var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' - var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } + var foundInvalidType = false; + for (var i = 0; i < acceptedTypes.length; i++) { + if (typeof acceptedTypes[i] === 'string') { + if (typeof value === acceptedTypes[i]) return true; + } else if (acceptedTypes[i] instanceof RegExp) { + if ((value || '').toString().match(acceptedTypes[i])) return true; + } else { + if (value instanceof acceptedTypes[i]) return true; + if (AWS.util.isType(value, acceptedTypes[i])) return true; + if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice(); + acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]); + } + foundInvalidType = true; + } - // http://www.w3.org/TR/REC-xml/#NT-NameStartChar - // This implementation works on strings, a single character at a time - // as such, it cannot ever support astral-plane characters (10000-EFFFF) - // without a significant breaking change to either this parser, or the - // JavaScript language. Implementation of an emoji-capable xml parser - // is left as an exercise for the reader. - var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var acceptedType = type; + if (!acceptedType) { + acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1'); + } - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : ''; + this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' + + vowel + ' ' + acceptedType); + return false; + }, - var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + validateNumber: function validateNumber(shape, value, context) { + if (value === null || value === undefined) return; + if (typeof value === 'string') { + var castedValue = parseFloat(value); + if (castedValue.toString() === value) value = castedValue; + } + if (this.validateType(value, context, ['number'])) { + this.validateRange(shape, value, context, 'numeric value'); + } + }, - function isWhitespace (c) { - return c === ' ' || c === '\n' || c === '\r' || c === '\t' - } + validatePayload: function validatePayload(value, context) { + if (value === null || value === undefined) return; + if (typeof value === 'string') return; + if (value && typeof value.byteLength === 'number') return; // typed arrays + if (AWS.util.isNode()) { // special check for buffer/stream in Node.js + var Stream = AWS.util.stream.Stream; + if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return; + } else { + if (typeof Blob !== void 0 && value instanceof Blob) return; + } - function isQuote (c) { - return c === '"' || c === '\'' - } + var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView']; + if (value) { + for (var i = 0; i < types.length; i++) { + if (AWS.util.isType(value, types[i])) return; + if (AWS.util.typeName(value.constructor) === types[i]) return; + } + } - function isAttribEnd (c) { - return c === '>' || isWhitespace(c) + this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' + + 'string, Buffer, Stream, Blob, or typed array object'); } +}); - function isMatch (regex, c) { - return regex.test(c) - } - function notMatch (regex, c) { - return !isMatch(regex, c) - } +/***/ }), - var S = 0 - sax.STATE = { - BEGIN: S++, // leading byte order mark or whitespace - BEGIN_WHITESPACE: S++, // leading whitespace - TEXT: S++, // general stuff - TEXT_ENTITY: S++, // & and such. - OPEN_WAKA: S++, // < - SGML_DECL: S++, // - SCRIPT: S++, //