diff --git a/action.yml b/action.yml
index 35ed01f..f8b01f3 100644
--- a/action.yml
+++ b/action.yml
@@ -1,6 +1,10 @@
name: 'Git Flow Action'
description: 'GithHub Action for checking the base branch of a pull request.'
inputs:
+ app_id:
+ description: 'App ID of the Git Flow Action app'
+ private_key:
+ description: 'Private key of the Git Flow Action app'
main_branch_pattern:
description: 'Main branch pattern'
required: true
diff --git a/index.js b/index.js
index 299f25e..f7e0b38 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,14 @@
const core = require("@actions/core");
const github = require("@actions/github");
-const octokit = getOctokit();
+const { graphql } = require("@octokit/graphql");
+const { Octokit: OctokitRest } = require("@octokit/rest");
+const { createAppAuth } = require("@octokit/auth-app");
+
+var octokitGraphQL = null;
+var octokitRest = null;
+
+console.log(github.context);
async function run() {
if (isTriggeredByPullRequestEvent()) {
@@ -101,19 +108,56 @@ function isPullRequestDraft() {
return github.context.payload.pull_request.draft;
}
-function getOctokit() {
- let token = process.env.GITHUB_TOKEN;
- if (token) {
- return github.getOctokit(token);
- } else {
- throw "The GITHUB_TOKEN environment variable must be set.";
+async function ensureOctokitAvailable() {
+ if (octokitRest === null || octokitGraphQL == null) {
+ octokit = await initializeOctokit();
}
}
+async function initializeOctokit() {
+ let privateKey = core.getInput('private_key', { required: true });
+ let appId = parseInt(core.getInput('app_id', { required: true }));
+
+ let appOctokit = new OctokitRest({
+ authStrategy: createAppAuth,
+ auth: {
+ appId: appId,
+ privateKey: privateKey,
+ },
+ });
+
+ let installations = await appOctokit.apps.listInstallations();
+ let installationId = installations.data[0].id;
+
+ octokitRest = new OctokitRest({
+ authStrategy: createAppAuth,
+ auth: {
+ appId: appId,
+ privateKey: privateKey,
+ installationId: installationId,
+ },
+ });
+
+ octokitGraphQL = graphql.defaults({
+ request: {
+ hook: createAppAuth({
+ appId: appId,
+ privateKey: privateKey,
+ installationId: installationId,
+ }).hook,
+ },
+ });
+}
+
async function convertPullRequestToDraft() {
+ await ensureOctokitAvailable();
+
let pullRequestId = github.context.payload.pull_request.node_id;
- await octokit.graphql(`
+ // Converting a PR to draft can only be done through the GraphQL API.
+ // But currently, that only seems to work with a personal access token (PAT).
+ // See: https://github.com/github/docs/issues/8925#issuecomment-970255180
+ await octokitGraphQL(`
mutation {
convertPullRequestToDraft(input: {pullRequestId: "${pullRequestId}"}) {
pullRequest {
@@ -125,13 +169,15 @@ async function convertPullRequestToDraft() {
}
async function postComment(comment) {
+ await ensureOctokitAvailable();
+
let pr = github.context.payload.pull_request;
let owner = pr.base.repo.owner.login;
let repo = pr.base.repo.name;
let prNumber = pr.number;
- await octokit.rest.issues.createComment({
+ await octokitRest.issues.createComment({
owner: owner,
repo: repo,
issue_number: prNumber,
diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver
new file mode 100644
index 0000000..d592e69
--- /dev/null
+++ b/node_modules/.bin/semver
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../semver/bin/semver" "$@"
+ ret=$?
+else
+ node "$basedir/../semver/bin/semver" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd
new file mode 100644
index 0000000..37c00a4
--- /dev/null
+++ b/node_modules/.bin/semver.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\semver\bin\semver" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\semver\bin\semver" %*
+)
\ No newline at end of file
diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity
index 81afac7..f171dca 100644
--- a/node_modules/.yarn-integrity
+++ b/node_modules/.yarn-integrity
@@ -7,37 +7,80 @@
"linkedModules": [],
"topLevelPatterns": [
"@actions/core@^1.6.0",
- "@actions/github@^5.0.0"
+ "@actions/github@^5.0.0",
+ "@octokit/auth-app@^3.6.1",
+ "@octokit/graphql@^4.8.0",
+ "@octokit/rest@^18.12.0"
],
"lockfileEntries": {
"@actions/core@^1.6.0": "https://registry.yarnpkg.com/@actions/core/-/core-1.6.0.tgz#0568e47039bfb6a9170393a73f3b7eb3b22462cb",
"@actions/github@^5.0.0": "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8",
"@actions/http-client@^1.0.11": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0",
+ "@octokit/auth-app@^3.6.1": "https://registry.yarnpkg.com/@octokit/auth-app/-/auth-app-3.6.1.tgz#aa5b02cc211175cbc28ce6c03c73373c1206d632",
+ "@octokit/auth-oauth-app@^4.3.0": "https://registry.yarnpkg.com/@octokit/auth-oauth-app/-/auth-oauth-app-4.3.0.tgz#de02f184360ffd7cfccef861053784fc4410e7ea",
+ "@octokit/auth-oauth-device@^3.1.1": "https://registry.yarnpkg.com/@octokit/auth-oauth-device/-/auth-oauth-device-3.1.2.tgz#d299f51f491669f37fe7af8738f5ac921e63973c",
+ "@octokit/auth-oauth-user@^1.2.1": "https://registry.yarnpkg.com/@octokit/auth-oauth-user/-/auth-oauth-user-1.3.0.tgz#da4e4529145181a6aa717ae858afb76ebd6e3360",
+ "@octokit/auth-oauth-user@^1.2.3": "https://registry.yarnpkg.com/@octokit/auth-oauth-user/-/auth-oauth-user-1.3.0.tgz#da4e4529145181a6aa717ae858afb76ebd6e3360",
"@octokit/auth-token@^2.4.4": "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36",
"@octokit/core@^3.4.0": "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b",
+ "@octokit/core@^3.5.1": "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b",
"@octokit/endpoint@^6.0.1": "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658",
"@octokit/graphql@^4.5.8": "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3",
+ "@octokit/graphql@^4.8.0": "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3",
+ "@octokit/oauth-authorization-url@^4.3.1": "https://registry.yarnpkg.com/@octokit/oauth-authorization-url/-/oauth-authorization-url-4.3.3.tgz#6a6ef38f243086fec882b62744f39b517528dfb9",
+ "@octokit/oauth-methods@^1.1.0": "https://registry.yarnpkg.com/@octokit/oauth-methods/-/oauth-methods-1.2.6.tgz#b9ac65e374b2cc55ee9dd8dcdd16558550438ea7",
"@octokit/openapi-types@^11.2.0": "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6",
"@octokit/plugin-paginate-rest@^2.13.3": "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz#32e9c7cab2a374421d3d0de239102287d791bce7",
+ "@octokit/plugin-paginate-rest@^2.16.8": "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz#32e9c7cab2a374421d3d0de239102287d791bce7",
+ "@octokit/plugin-request-log@^1.0.4": "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85",
"@octokit/plugin-rest-endpoint-methods@^5.1.1": "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba",
+ "@octokit/plugin-rest-endpoint-methods@^5.12.0": "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba",
"@octokit/request-error@^2.0.5": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677",
"@octokit/request-error@^2.1.0": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677",
+ "@octokit/request@^5.3.0": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8",
+ "@octokit/request@^5.4.14": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8",
"@octokit/request@^5.6.0": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8",
+ "@octokit/rest@^18.12.0": "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881",
"@octokit/types@^6.0.3": "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218",
+ "@octokit/types@^6.10.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218",
+ "@octokit/types@^6.12.2": "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218",
"@octokit/types@^6.16.1": "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218",
"@octokit/types@^6.34.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218",
+ "@types/btoa-lite@^1.0.0": "https://registry.yarnpkg.com/@types/btoa-lite/-/btoa-lite-1.0.0.tgz#e190a5a548e0b348adb0df9ac7fa5f1151c7cca4",
+ "@types/jsonwebtoken@^8.3.3": "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz#1913e5a61e70a192c5a444623da4901a7b1a9d42",
+ "@types/lru-cache@^5.1.0": "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef",
+ "@types/node@*": "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42",
"before-after-hook@^2.2.0": "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e",
+ "btoa-lite@^1.0.0": "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337",
+ "buffer-equal-constant-time@1.0.1": "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819",
"deprecation@^2.0.0": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919",
"deprecation@^2.3.1": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919",
+ "ecdsa-sig-formatter@1.0.11": "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf",
"is-plain-object@^5.0.0": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344",
+ "jsonwebtoken@^8.5.1": "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d",
+ "jwa@^1.4.1": "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a",
+ "jws@^3.2.2": "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304",
+ "lodash.includes@^4.3.0": "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f",
+ "lodash.isboolean@^3.0.3": "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6",
+ "lodash.isinteger@^4.0.4": "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343",
+ "lodash.isnumber@^3.0.3": "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc",
+ "lodash.isplainobject@^4.0.6": "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb",
+ "lodash.isstring@^4.0.1": "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451",
+ "lodash.once@^4.0.0": "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac",
+ "lru-cache@^6.0.0": "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94",
+ "ms@^2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2",
"node-fetch@^2.6.1": "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89",
"once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
+ "safe-buffer@^5.0.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
+ "semver@^5.6.0": "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7",
"tr46@~0.0.3": "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a",
"tunnel@0.0.6": "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
+ "universal-github-app-jwt@^1.0.1": "https://registry.yarnpkg.com/universal-github-app-jwt/-/universal-github-app-jwt-1.1.0.tgz#0abaa876101cdf1d3e4c546be2768841c0c1b514",
"universal-user-agent@^6.0.0": "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee",
"webidl-conversions@^3.0.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871",
"whatwg-url@^5.0.0": "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d",
- "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
+ "yallist@^4.0.0": "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
},
"files": [],
"artifacts": {}
diff --git a/node_modules/@octokit/auth-app/LICENSE b/node_modules/@octokit/auth-app/LICENSE
new file mode 100644
index 0000000..ef2c18e
--- /dev/null
+++ b/node_modules/@octokit/auth-app/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2019 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@octokit/auth-app/README.md b/node_modules/@octokit/auth-app/README.md
new file mode 100644
index 0000000..819b3fa
--- /dev/null
+++ b/node_modules/@octokit/auth-app/README.md
@@ -0,0 +1,1396 @@
+# auth-app.js
+
+> GitHub App authentication for JavaScript
+
+[![@latest](https://img.shields.io/npm/v/@octokit/auth-app.svg)](https://www.npmjs.com/package/@octokit/auth-app)
+[![Build Status](https://github.com/octokit/auth-app.js/workflows/Test/badge.svg)](https://github.com/octokit/auth-app.js/actions?query=workflow%3ATest)
+
+`@octokit/auth-app` implements authentication for GitHub Apps using [JSON Web Token](https://jwt.io/), installation access tokens, and OAuth user-to-server access tokens.
+
+
+
+- [Standalone usage](#standalone-usage)
+ - [Authenticate as GitHub App (JSON Web Token)](#authenticate-as-github-app-json-web-token)
+ - [Authenticate as OAuth App (client ID/client secret)](#authenticate-as-oauth-app-client-idclient-secret)
+ - [Authenticate as installation](#authenticate-as-installation)
+ - [Authenticate as user](#authenticate-as-user)
+- [Usage with Octokit](#usage-with-octokit)
+- [`createAppAuth(options)` or `new Octokit({ auth })`](#createappauthoptions-or-new-octokit-auth-)
+- [`auth(options)` or `octokit.auth(options)`](#authoptions-or-octokitauthoptions)
+ - [JSON Web Token (JWT) Authentication](#json-web-token-jwt-authentication)
+ - [OAuth App authentication](#oauth-app-authentication)
+ - [Installation authentication](#installation-authentication)
+ - [User authentication (web flow)](#user-authentication-web-flow)
+ - [User authentication (device flow)](#user-authentication-device-flow)
+- [Authentication object](#authentication-object)
+ - [JSON Web Token (JWT) authentication](#json-web-token-jwt-authentication)
+ - [OAuth App authentication](#oauth-app-authentication-1)
+ - [Installation access token authentication](#installation-access-token-authentication)
+ - [GitHub APP user authentication token with expiring disabled](#github-app-user-authentication-token-with-expiring-disabled)
+ - [GitHub APP user authentication token with expiring enabled](#github-app-user-authentication-token-with-expiring-enabled)
+- [`auth.hook(request, route, parameters)` or `auth.hook(request, options)`](#authhookrequest-route-parameters-or-authhookrequest-options)
+- [Types](#types)
+- [Implementation details](#implementation-details)
+- [License](#license)
+
+
+
+## Standalone usage
+
+
+
+
+Browsers
+ |
+
+⚠️ `@octokit/auth-app` is not meant for usage in the browser. A private key and client secret must not be exposed to users.
+
+The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:
+
+```shell
+openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
+```
+
+The OAuth APIs to create user-to-server tokens cannot be used because they do not have CORS enabled.
+
+If you know what you are doing, load `@octokit/auth-app` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+Node
+ |
+
+Install with npm install @octokit/auth-app
+
+```js
+const { createAppAuth } = require("@octokit/auth-app");
+// or: import { createAppAuth } from "@octokit/auth-app";
+```
+
+ |
+
+
+
+### Authenticate as GitHub App (JSON Web Token)
+
+```js
+const auth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12341234567890abcdef1234",
+});
+
+// Retrieve JSON Web Token (JWT) to authenticate as app
+const appAuthentication = await auth({ type: "app" });
+```
+
+resolves with
+
+```json
+{
+ "type": "app",
+ "token": "jsonwebtoken123",
+ "appId": 123,
+ "expiresAt": "2018-07-07T00:09:30.000Z"
+}
+```
+
+### Authenticate as OAuth App (client ID/client secret)
+
+The [OAuth Application APIs](https://docs.github.com/en/rest/reference/apps#oauth-applications-api) require the app to authenticate using clientID/client as Basic Authentication
+
+```js
+const auth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12341234567890abcdef1234",
+});
+
+const appAuthentication = await auth({
+ type: "oauth-app",
+});
+```
+
+resolves with
+
+```json
+{
+ "type": "oauth-app",
+ "clientId": "lv1.1234567890abcdef",
+ "clientSecret": "1234567890abcdef1234567890abcdef12345678",
+ "headers": {
+ "authorization": "basic bHYxLjEyMzQ1Njc4OTBhYmNkZWY6MTIzNDU2Nzg5MGFiY2RlZjEyMzQ1Njc4OTBhYmNkZWYxMjM0NTY3OA=="
+ }
+}
+```
+
+### Authenticate as installation
+
+```js
+const auth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12341234567890abcdef1234",
+});
+
+// Retrieve installation access token
+const installationAuthentication = await auth({
+ type: "installation",
+ installationId: 123,
+});
+```
+
+resolves with
+
+```json
+{
+ "type": "token",
+ "tokenType": "installation",
+ "token": "token123",
+ "installationId": 123,
+ "createdAt": "2018-07-07T00:00:00.000Z",
+ "expiresAt": "2018-07-07T00:59:00.000Z"
+}
+```
+
+### Authenticate as user
+
+```js
+const auth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12341234567890abcdef1234",
+});
+
+// Retrieve an oauth-access token
+const userAuthentication = await auth({ type: "oauth-user", code: "123456" });
+```
+
+Resolves with
+
+```json
+{
+ "type": "token",
+ "tokenType": "oauth",
+ "token": "token123"
+}
+```
+
+## Usage with Octokit
+
+
+
+
+
+Browsers
+
+ |
+
+⚠️ `@octokit/auth-app` is not meant for usage in the browser. A private key and client secret must not be exposed to users.
+
+The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:
+
+```shell
+openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
+```
+
+The OAuth APIs to create user-to-server tokens cannot be used because they do not have CORS enabled.
+
+If you know what you are doing, load `@octokit/auth-app` and `@octokit/core` (or a compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/core @octokit/auth-app`. Optionally replace `@octokit/core` with a compatible module
+
+```js
+const { Octokit } = require("@octokit/core");
+const { createAppAuth, createOAuthUserAuth } = require("@octokit/auth-app");
+```
+
+ |
+
+
+
+```js
+const appOctokit = new Octokit({
+ authStrategy: createAppAuth,
+ auth: {
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ },
+});
+
+// Send requests as GitHub App
+const { slug } = await appOctokit.request("GET /user");
+console.log("authenticated as %s", slug);
+
+// Send requests as OAuth App
+await appOctokit.request("POST /application/{client_id}/token", {
+ client_id: "1234567890abcdef1234",
+ access_token: "existingtoken123",
+});
+console.log("token is valid");
+
+// create a new octokit instance that is authenticated as the user
+const userOctokit = await appOctokit.auth({
+ type: "oauth-user",
+ code: "code123",
+ factory: (options) => {
+ return new Octokit({
+ authStrategy: createOAuthUserAuth,
+ auth: options,
+ });
+ },
+});
+
+// Exchanges the code for the user access token authentication on first request
+// and caches the authentication for successive requests
+const {
+ data: { login },
+} = await userOctokit.request("GET /user");
+console.log("Hello, %s!", login);
+```
+
+In order to create an `octokit` instance that is authenticated as an installation, with automated installation token refresh, set `installationId` as `auth` option
+
+```js
+const installationOctokit = new Octokit({
+ authStrategy: createAppAuth,
+ auth: {
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ installationId: 123,
+ },
+});
+
+// transparently creates an installation access token the first time it is needed
+// and refreshes it when it expires
+await installationOctokit.request("POST /repos/{owner}/{repo}/issues", {
+ owner: "octocat",
+ repo: "hello-world",
+ title: "title",
+});
+```
+
+## `createAppAuth(options)` or `new Octokit({ auth })`
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ appId
+ |
+
+ number
+ |
+
+ Required. Find App ID on the app’s about page in settings.
+ |
+
+
+
+ privateKey
+ |
+
+ string
+ |
+
+ Required. Content of the *.pem file you downloaded from the app’s about page. You can generate a new private key if needed.
+ |
+
+
+
+ installationId
+ |
+
+ number
+ |
+
+ Default installationId to be used when calling auth({ type: "installation" }) .
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The client ID of the GitHub App.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ A client secret for the GitHub App.
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+
+Automatically set to `octokit.request` when using with an `Octokit` constructor.
+
+For standalone usage, you can pass in your own [`@octokit/request`](https://github.com/octokit/request.js) instance. For usage with enterprise, set `baseUrl` to the hostname + `/api/v3`. Example:
+
+```js
+const { request } = require("@octokit/request");
+createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+ cache
+ |
+
+ object
+ |
+
+ Installation tokens expire after an hour. By default, @octokit/auth-app is caching up to 15000 tokens simultaneously using lru-cache. You can pass your own cache implementation by passing options.cache.{get,set} to the constructor. Example:
+
+```js
+const CACHE = {};
+createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ cache: {
+ async get(key) {
+ return CACHE[key];
+ },
+ async set(key, value) {
+ CACHE[key] = value;
+ },
+ },
+});
+```
+
+ |
+
+
+ log
+ |
+
+ object
+ |
+
+ You can pass in your preferred logging tool by passing option.log to the constructor. If you would like to make the log level configurable using an environment variable or external option, we recommend the console-log-level package. For example:
+
+```js
+createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ log: require("console-log-level")({ level: "info" }),
+});
+```
+
+ |
+
+
+
+## `auth(options)` or `octokit.auth(options)`
+
+The async `auth()` method accepts different options depending on your use case
+
+### JSON Web Token (JWT) Authentication
+
+Authenticate as the GitHub app to list installations, repositories, and create installation access tokens.
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be either "app" .
+ |
+
+
+
+
+### OAuth App authentication
+
+Create, reset, refresh, delete OAuth user-to-server tokens
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be either "oauth-app" .
+ |
+
+
+
+
+### Installation authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be "installation" .
+ |
+
+
+
+ installationId
+ |
+
+ number
+ |
+
+ Required unless a default installationId was passed to createAppAuth() . ID of installation to retrieve authentication for.
+ |
+
+
+
+ repositoryIds
+ |
+
+ array of numbers
+ |
+
+ The id of the repositories that the installation token can access. Also known as a databaseID when querying the repository object in GitHub's GraphQL API. This option is **(recommended)** over repositoryNames when needing to limit the scope of the access token, due to repositoryNames having the possibility of changing. Additionally, you should only include either repositoryIds or repositoryNames , but not both.
+ |
+
+
+
+ repositoryNames
+ |
+
+ array of strings
+ |
+
+ The name of the repositories that the installation token can access. As mentioned in the repositoryIds description, you should only include either repositoryIds or repositoryNames , but not both.
+ |
+
+
+
+ permissions
+ |
+
+ object
+ |
+
+ The permissions granted to the access token. The permissions object includes the permission names and their access type. For a complete list of permissions and allowable values, see GitHub App permissions.
+ |
+
+
+
+ factory
+ |
+
+ function
+ |
+
+
+The `auth({type: "installation", installationId, factory })` call with resolve with whatever the factory function returns. The `factory` function will be called with all the strategy option that `auth` was created with, plus the additional options passed to `auth`, besides `type` and `factory`.
+
+For example, you can create a new `auth` instance for an installation which shares the internal state (especially the access token cache) with the calling `auth` instance:
+
+```js
+const appAuth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+});
+
+const installationAuth123 = await appAuth({
+ type: "installation",
+ installationId: 123,
+ factory: createAppAuth,
+});
+```
+
+ |
+
+
+
+ refresh
+ |
+
+ boolean
+ |
+
+
+Installation tokens expire after one hour. By default, tokens are cached and returned from cache until expired. To bypass and update a cached token for the given `installationId`, set `refresh` to `true`.
+
+Defaults to `false`.
+
+ |
+
+
+
+
+### User authentication (web flow)
+
+Exchange code received from the web flow redirect described in [step 2 of GitHub's OAuth web flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow)
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be "oauth-user" .
+ |
+
+
+
+ factory
+ |
+
+ function
+ |
+
+
+The `auth({type: "oauth-user", factory })` call with resolve with whatever the factory function returns. The `factory` function will be called with all the strategy option that `auth` was created with, plus the additional options passed to `auth`, besides `type` and `factory`.
+
+For example, you can create a new `auth` instance for an installation which shares the internal state (especially the access token cache) with the calling `auth` instance:
+
+```js
+const {
+ createAppAuth,
+ createOAuthUserAuth,
+} = require("@octokit/auth-oauth-app");
+
+const appAuth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuth = await appAuth({
+ type: "oauth-user",
+ code,
+ factory: createOAuthUserAuth,
+});
+
+// will create token upon first call, then cache authentication for successive calls,
+// until token needs to be refreshed (if enabled for the GitHub App)
+const authentication = await userAuth();
+```
+
+ |
+
+
+
+ code
+ |
+
+ string
+ |
+
+ The authorization code which was passed as query parameter to the callback URL from the OAuth web application flow.
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+ The URL in your application where users are sent after authorization. See redirect urls.
+ |
+
+
+
+ state
+ |
+
+ string
+ |
+
+ The unguessable random string you provided in Step 1 of the OAuth web application flow.
+ |
+
+
+
+
+### User authentication (device flow)
+
+Create a token using [GitHub's device flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow).
+
+The device flow does not require a client secret, but it is required as strategy option for `@octokit/auth-app`, even for the device flow. If you want to implement the device flow without requiring a client secret, use [`@octokit/auth-oauth-device`](https://github.com/octokit/auth-oauth-device.js#readme).
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be "oauth-user" .
+ |
+
+
+
+ onVerification
+ |
+
+ function
+ |
+
+
+**Required**. A function that is called once the device and user codes were retrieved.
+
+The `onVerification()` callback can be used to pause until the user completes step 2, which might result in a better user experience.
+
+```js
+const auth = auth({
+ type: "oauth-user",
+ onVerification(verification) {
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+ await prompt("press enter when you are ready to continue");
+ },
+});
+```
+
+ |
+
+
+
+ factory
+ |
+
+ function
+ |
+
+
+The `auth({type: "oauth-user", factory })` call with resolve with whatever the factory function returns. The `factory` function will be called with all the strategy option that `auth` was created with, plus the additional options passed to `auth`, besides `type` and `factory`.
+
+For example, you can create a new `auth` instance for an installation which shares the internal state (especially the access token cache) with the calling `auth` instance:
+
+```js
+const {
+ createAppAuth,
+ createOAuthUserAuth,
+} = require("@octokit/auth-oauth-app");
+
+const appAuth = createAppAuth({
+ appId: 1,
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuth = await appAuth({
+ type: "oauth-user",
+ code,
+ factory: createOAuthUserAuth,
+});
+
+// will create token upon first call, then cache authentication for successive calls,
+// until token needs to be refreshed (if enabled for the GitHub App)
+const authentication = await userAuth();
+```
+
+ |
+
+
+
+
+## Authentication object
+
+Depending on on the `auth()` call, the resulting authentication object can be one of
+
+1. JSON Web Token (JWT) authentication
+1. OAuth App authentication
+1. Installation access token authentication
+1. GitHub APP user authentication token with expiring disabled
+1. GitHub APP user authentication token with expiring enabled
+
+### JSON Web Token (JWT) authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "app"
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The JSON Web Token (JWT) to authenticate as the app.
+ |
+
+
+
+ appId
+ |
+
+ number
+ |
+
+ GitHub App database ID.
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Timestamp in UTC format, e.g. "2018-07-07T00:09:30.000Z" . A Date object can be created using new Date(authentication.expiresAt) .
+ |
+
+
+
+
+### OAuth App authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "oauth-app"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The client ID as passed to the constructor.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The client secret as passed to the constructor.
+ |
+
+
+
+ headers
+ |
+
+ object
+ |
+
+ { authorization } .
+ |
+
+
+
+
+### Installation access token authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The installation access token.
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "installation"
+ |
+
+
+
+ installationId
+ |
+
+ number
+ |
+
+ Installation database ID.
+ |
+
+
+
+ createdAt
+ |
+
+ string
+ |
+
+ Timestamp in UTC format, e.g. "2018-07-07T00:00:00.000Z" . A Date object can be created using new Date(authentication.expiresAt) .
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Timestamp in UTC format, e.g. "2018-07-07T00:59:00.000Z" . A Date object can be created using new Date(authentication.expiresAt) .
+ |
+
+
+
+ repositoryIds
+ |
+
+ array of numbers
+ |
+
+ Only present if repositoryIds option passed to auth(options) .
+ |
+
+
+
+ repositoryNames
+ |
+
+ array of strings
+ |
+
+ Only present if repositoryNames option passed to auth(options) .
+ |
+
+
+
+ permissions
+ |
+
+ object
+ |
+
+ An object where keys are the permission name and the value is either "read" or "write" . See the list of all GitHub App Permissions.
+ |
+
+
+
+ singleFileName
+ |
+
+ string
+ |
+
+ If the single file permission is enabled, the singleFileName property is set to the path of the accessible file.
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring disabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ One of the app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring enabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ One of the app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ The refresh token
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+
+## `auth.hook(request, route, parameters)` or `auth.hook(request, options)`
+
+`auth.hook()` hooks directly into the request life cycle. It amends the request to authenticate either as app or as installation based on the request URL. Although the `"machine-man"` preview has graduated to the official API, https://developer.github.com/changes/2020-08-20-graduate-machine-man-and-sailor-v-previews/, it is still required in versions of GitHub Enterprise up to 2.21 so it automatically sets the `"machine-man"` preview for all endpoints requiring JWT authentication.
+
+The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The arguments are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
+
+`auth.hook()` can be called directly to send an authenticated request
+
+```js
+const { data: installations } = await auth.hook(
+ request,
+ "GET /app/installations"
+);
+```
+
+Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
+
+```js
+const requestWithAuth = request.defaults({
+ request: {
+ hook: auth.hook,
+ },
+});
+
+const { data: installations } = await requestWithAuth("GET /app/installations");
+```
+
+Note that `auth.hook()` does not create and set an OAuth authentication token. But you can use [`@octokit/auth-oauth-app`](https://github.com/octokit/auth-oauth-app.js#readme) for that functionality. And if you don't plan on sending requests to routes that require authentication with `client_id` and `client_secret`, you can just retrieve the token and then create a new instance of [`request()`](https://github.com/octokit/request.js#request) with the authentication header set:
+
+```js
+const { token } = await auth({
+ type: "oauth-user",
+ code: "123456",
+});
+const requestWithAuth = request.defaults({
+ headers: {
+ authentication: `token ${token}`,
+ },
+});
+```
+
+## Types
+
+```ts
+import {
+ // strategy options
+ StrategyOptions,
+ // auth options
+ AuthOptions,
+ AppAuthOptions,
+ OAuthAppAuthOptions,
+ InstallationAuthOptions,
+ OAuthWebFlowAuthOptions,
+ OAuthDeviceFlowAuthOptions,
+ // authentication objects
+ Authentication,
+ AppAuthentication,
+ OAuthAppAuthentication,
+ InstallationAccessTokenAuthentication,
+ GitHubAppUserAuthentication,
+ GitHubAppUserAuthenticationWithExpiration,
+} from "@octokit/auth-app";
+```
+
+## Implementation details
+
+When creating a JSON Web Token, it sets the "issued at time" (iat) to 30s in the past as we have seen people running situations where the GitHub API claimed the iat would be in future. It turned out the clocks on the different machine were not in sync.
+
+Installation access tokens are valid for 60 minutes. This library invalidates them after 59 minutes to account for request delays.
+
+All OAuth features are implemented internally using [@octokit/auth-oauth-app](https://github.com/octokit/auth-oauth-app.js/#readme).
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/auth-app/dist-node/index.js b/node_modules/@octokit/auth-app/dist-node/index.js
new file mode 100644
index 0000000..c514431
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-node/index.js
@@ -0,0 +1,538 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
+
+var universalUserAgent = require('universal-user-agent');
+var request = require('@octokit/request');
+var authOauthApp = require('@octokit/auth-oauth-app');
+var deprecation = require('deprecation');
+var universalGithubAppJwt = require('universal-github-app-jwt');
+var LRU = _interopDefault(require('lru-cache'));
+var authOauthUser = require('@octokit/auth-oauth-user');
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+
+ if (enumerableOnly) {
+ symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ }
+
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+
+ var key, i;
+
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+async function getAppAuthentication({
+ appId,
+ privateKey,
+ timeDifference
+}) {
+ try {
+ const appAuthentication = await universalGithubAppJwt.githubAppJwt({
+ id: +appId,
+ privateKey,
+ now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference
+ });
+ return {
+ type: "app",
+ token: appAuthentication.token,
+ appId: appAuthentication.appId,
+ expiresAt: new Date(appAuthentication.expiration * 1000).toISOString()
+ };
+ } catch (error) {
+ if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
+ throw new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'");
+ } else {
+ throw error;
+ }
+ }
+}
+
+// https://github.com/isaacs/node-lru-cache#readme
+function getCache() {
+ return new LRU({
+ // cache max. 15000 tokens, that will use less than 10mb memory
+ max: 15000,
+ // Cache for 1 minute less than GitHub expiry
+ maxAge: 1000 * 60 * 59
+ });
+}
+async function get(cache, options) {
+ const cacheKey = optionsToCacheKey(options);
+ const result = await cache.get(cacheKey);
+
+ if (!result) {
+ return;
+ }
+
+ const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName] = result.split("|");
+ const permissions = options.permissions || permissionsString.split(/,/).reduce((permissions, string) => {
+ if (/!$/.test(string)) {
+ permissions[string.slice(0, -1)] = "write";
+ } else {
+ permissions[string] = "read";
+ }
+
+ return permissions;
+ }, {});
+ return {
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositoryIds: options.repositoryIds,
+ repositoryNames: options.repositoryNames,
+ singleFileName,
+ repositorySelection: repositorySelection
+ };
+}
+async function set(cache, options, data) {
+ const key = optionsToCacheKey(options);
+ const permissionsString = options.permissions ? "" : Object.keys(data.permissions).map(name => `${name}${data.permissions[name] === "write" ? "!" : ""}`).join(",");
+ const value = [data.token, data.createdAt, data.expiresAt, data.repositorySelection, permissionsString, data.singleFileName].join("|");
+ await cache.set(key, value);
+}
+
+function optionsToCacheKey({
+ installationId,
+ permissions = {},
+ repositoryIds = [],
+ repositoryNames = []
+}) {
+ const permissionsString = Object.keys(permissions).sort().map(name => permissions[name] === "read" ? name : `${name}!`).join(",");
+ const repositoryIdsString = repositoryIds.sort().join(",");
+ const repositoryNamesString = repositoryNames.join(",");
+ return [installationId, repositoryIdsString, repositoryNamesString, permissionsString].filter(Boolean).join("|");
+}
+
+function toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName
+}) {
+ return Object.assign({
+ type: "token",
+ tokenType: "installation",
+ token,
+ installationId,
+ permissions,
+ createdAt,
+ expiresAt,
+ repositorySelection
+ }, repositoryIds ? {
+ repositoryIds
+ } : null, repositoryNames ? {
+ repositoryNames
+ } : null, singleFileName ? {
+ singleFileName
+ } : null);
+}
+
+const _excluded = ["type", "factory", "oauthApp"];
+async function getInstallationAuthentication(state, options, customRequest) {
+ const installationId = Number(options.installationId || state.installationId);
+
+ if (!installationId) {
+ throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");
+ }
+
+ if (options.factory) {
+ const _state$options = _objectSpread2(_objectSpread2({}, state), options),
+ {
+ type,
+ factory,
+ oauthApp
+ } = _state$options,
+ factoryAuthOptions = _objectWithoutProperties(_state$options, _excluded); // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise>`
+
+
+ return factory(factoryAuthOptions);
+ }
+
+ const optionsWithInstallationTokenFromState = Object.assign({
+ installationId
+ }, options);
+
+ if (!options.refresh) {
+ const result = await get(state.cache, optionsWithInstallationTokenFromState);
+
+ if (result) {
+ const {
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ repositorySelection
+ } = result;
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositorySelection,
+ repositoryIds,
+ repositoryNames,
+ singleFileName
+ });
+ }
+ }
+
+ const appAuthentication = await getAppAuthentication(state);
+ const request = customRequest || state.request;
+ const {
+ data: {
+ token,
+ expires_at: expiresAt,
+ repositories,
+ permissions: permissionsOptional,
+ repository_selection: repositorySelectionOptional,
+ single_file: singleFileName
+ }
+ } = await request("POST /app/installations/{installation_id}/access_tokens", {
+ installation_id: installationId,
+ repository_ids: options.repositoryIds,
+ repositories: options.repositoryNames,
+ permissions: options.permissions,
+ mediaType: {
+ previews: ["machine-man"]
+ },
+ headers: {
+ authorization: `bearer ${appAuthentication.token}`
+ }
+ });
+ /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */
+
+ const permissions = permissionsOptional || {};
+ /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */
+
+ const repositorySelection = repositorySelectionOptional || "all";
+ const repositoryIds = repositories ? repositories.map(r => r.id) : void 0;
+ const repositoryNames = repositories ? repositories.map(repo => repo.name) : void 0;
+ const createdAt = new Date().toISOString();
+ await set(state.cache, optionsWithInstallationTokenFromState, {
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName
+ });
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName
+ });
+}
+
+async function auth(state, authOptions) {
+ switch (authOptions.type) {
+ case "app":
+ return getAppAuthentication(state);
+ // @ts-expect-error "oauth" is not supperted in types
+
+ case "oauth":
+ state.log.warn( // @ts-expect-error `log.warn()` expects string
+ new deprecation.Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`));
+
+ case "oauth-app":
+ return state.oauthApp({
+ type: "oauth-app"
+ });
+
+ case "installation":
+ return getInstallationAuthentication(state, _objectSpread2(_objectSpread2({}, authOptions), {}, {
+ type: "installation"
+ }));
+
+ case "oauth-user":
+ // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as "WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions"
+ return state.oauthApp(authOptions);
+
+ default:
+ // @ts-expect-error type is "never" at this point
+ throw new Error(`Invalid auth type: ${authOptions.type}`);
+ }
+}
+
+const PATHS = ["/app", "/app/hook/config", "/app/hook/deliveries", "/app/hook/deliveries/{delivery_id}", "/app/hook/deliveries/{delivery_id}/attempts", "/app/installations", "/app/installations/{installation_id}", "/app/installations/{installation_id}/access_tokens", "/app/installations/{installation_id}/suspended", "/marketplace_listing/accounts/{account_id}", "/marketplace_listing/plan", "/marketplace_listing/plans", "/marketplace_listing/plans/{plan_id}/accounts", "/marketplace_listing/stubbed/accounts/{account_id}", "/marketplace_listing/stubbed/plan", "/marketplace_listing/stubbed/plans", "/marketplace_listing/stubbed/plans/{plan_id}/accounts", "/orgs/{org}/installation", "/repos/{owner}/{repo}/installation", "/users/{username}/installation"]; // CREDIT: Simon Grondin (https://github.com/SGrondin)
+// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js
+
+function routeMatcher(paths) {
+ // EXAMPLE. For the following paths:
+
+ /* [
+ "/orgs/{org}/invitations",
+ "/repos/{owner}/{repo}/collaborators/{username}"
+ ] */
+ const regexes = paths.map(p => p.split("/").map(c => c.startsWith("{") ? "(?:.+?)" : c).join("/")); // 'regexes' would contain:
+
+ /* [
+ '/orgs/(?:.+?)/invitations',
+ '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
+ ] */
+
+ const regex = `^(?:${regexes.map(r => `(?:${r})`).join("|")})[^/]*$`; // 'regex' would contain:
+
+ /*
+ ^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
+ It may look scary, but paste it into https://www.debuggex.com/
+ and it will make a lot more sense!
+ */
+
+ return new RegExp(regex, "i");
+}
+
+const REGEX = routeMatcher(PATHS);
+function requiresAppAuth(url) {
+ return !!url && REGEX.test(url);
+}
+
+const FIVE_SECONDS_IN_MS = 5 * 1000;
+
+function isNotTimeSkewError(error) {
+ return !(error.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/) || error.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/));
+}
+
+async function hook(state, request, route, parameters) {
+ const endpoint = request.endpoint.merge(route, parameters);
+ const url = endpoint.url; // Do not intercept request to retrieve a new token
+
+ if (/\/login\/oauth\/access_token$/.test(url)) {
+ return request(endpoint);
+ }
+
+ if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, ""))) {
+ const {
+ token
+ } = await getAppAuthentication(state);
+ endpoint.headers.authorization = `bearer ${token}`;
+ let response;
+
+ try {
+ response = await request(endpoint);
+ } catch (error) {
+ // If there's an issue with the expiration, regenerate the token and try again.
+ // Otherwise rethrow the error for upstream handling.
+ if (isNotTimeSkewError(error)) {
+ throw error;
+ } // If the date header is missing, we can't correct the system time skew.
+ // Throw the error to be handled upstream.
+
+
+ if (typeof error.response.headers.date === "undefined") {
+ throw error;
+ }
+
+ const diff = Math.floor((Date.parse(error.response.headers.date) - Date.parse(new Date().toString())) / 1000);
+ state.log.warn(error.message);
+ state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);
+ const {
+ token
+ } = await getAppAuthentication(_objectSpread2(_objectSpread2({}, state), {}, {
+ timeDifference: diff
+ }));
+ endpoint.headers.authorization = `bearer ${token}`;
+ return request(endpoint);
+ }
+
+ return response;
+ }
+
+ if (authOauthUser.requiresBasicAuth(url)) {
+ const authentication = await state.oauthApp({
+ type: "oauth-app"
+ });
+ endpoint.headers.authorization = authentication.headers.authorization;
+ return request(endpoint);
+ }
+
+ const {
+ token,
+ createdAt
+ } = await getInstallationAuthentication(state, // @ts-expect-error TBD
+ {}, request);
+ endpoint.headers.authorization = `token ${token}`;
+ return sendRequestWithRetries(state, request, endpoint, createdAt);
+}
+/**
+ * Newly created tokens might not be accessible immediately after creation.
+ * In case of a 401 response, we retry with an exponential delay until more
+ * than five seconds pass since the creation of the token.
+ *
+ * @see https://github.com/octokit/auth-app.js/issues/65
+ */
+
+async function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {
+ const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);
+
+ try {
+ return await request(options);
+ } catch (error) {
+ if (error.status !== 401) {
+ throw error;
+ }
+
+ if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {
+ if (retries > 0) {
+ error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;
+ }
+
+ throw error;
+ }
+
+ ++retries;
+ const awaitTime = retries * 1000;
+ state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);
+ await new Promise(resolve => setTimeout(resolve, awaitTime));
+ return sendRequestWithRetries(state, request, options, createdAt, retries);
+ }
+}
+
+const VERSION = "3.6.1";
+
+function createAppAuth(options) {
+ if (!options.appId) {
+ throw new Error("[@octokit/auth-app] appId option is required");
+ }
+
+ if (!options.privateKey) {
+ throw new Error("[@octokit/auth-app] privateKey option is required");
+ }
+
+ if ("installationId" in options && !options.installationId) {
+ throw new Error("[@octokit/auth-app] installationId is set to a falsy value");
+ }
+
+ const log = Object.assign({
+ warn: console.warn.bind(console)
+ }, options.log);
+ const request$1 = options.request || request.request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
+ }
+ });
+ const state = Object.assign({
+ request: request$1,
+ cache: getCache()
+ }, options, options.installationId ? {
+ installationId: Number(options.installationId)
+ } : {}, {
+ log,
+ oauthApp: authOauthApp.createOAuthAppAuth({
+ clientType: "github-app",
+ clientId: options.clientId || "",
+ clientSecret: options.clientSecret || "",
+ request: request$1
+ })
+ }); // @ts-expect-error not worth the extra code to appease TS
+
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state)
+ });
+}
+
+Object.defineProperty(exports, 'createOAuthUserAuth', {
+ enumerable: true,
+ get: function () {
+ return authOauthUser.createOAuthUserAuth;
+ }
+});
+exports.createAppAuth = createAppAuth;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-app/dist-node/index.js.map b/node_modules/@octokit/auth-app/dist-node/index.js.map
new file mode 100644
index 0000000..3987878
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/get-app-authentication.js","../dist-src/cache.js","../dist-src/to-token-authentication.js","../dist-src/get-installation-authentication.js","../dist-src/auth.js","../dist-src/requires-app-auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { githubAppJwt } from \"universal-github-app-jwt\";\nexport async function getAppAuthentication({ appId, privateKey, timeDifference, }) {\n try {\n const appAuthentication = await githubAppJwt({\n id: +appId,\n privateKey,\n now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,\n });\n return {\n type: \"app\",\n token: appAuthentication.token,\n appId: appAuthentication.appId,\n expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),\n };\n }\n catch (error) {\n if (privateKey === \"-----BEGIN RSA PRIVATE KEY-----\") {\n throw new Error(\"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\\n'\");\n }\n else {\n throw error;\n }\n }\n}\n","// https://github.com/isaacs/node-lru-cache#readme\nimport LRU from \"lru-cache\";\nexport function getCache() {\n return new LRU({\n // cache max. 15000 tokens, that will use less than 10mb memory\n max: 15000,\n // Cache for 1 minute less than GitHub expiry\n maxAge: 1000 * 60 * 59,\n });\n}\nexport async function get(cache, options) {\n const cacheKey = optionsToCacheKey(options);\n const result = await cache.get(cacheKey);\n if (!result) {\n return;\n }\n const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split(\"|\");\n const permissions = options.permissions ||\n permissionsString.split(/,/).reduce((permissions, string) => {\n if (/!$/.test(string)) {\n permissions[string.slice(0, -1)] = \"write\";\n }\n else {\n permissions[string] = \"read\";\n }\n return permissions;\n }, {});\n return {\n token,\n createdAt,\n expiresAt,\n permissions,\n repositoryIds: options.repositoryIds,\n repositoryNames: options.repositoryNames,\n singleFileName,\n repositorySelection: repositorySelection,\n };\n}\nexport async function set(cache, options, data) {\n const key = optionsToCacheKey(options);\n const permissionsString = options.permissions\n ? \"\"\n : Object.keys(data.permissions)\n .map((name) => `${name}${data.permissions[name] === \"write\" ? \"!\" : \"\"}`)\n .join(\",\");\n const value = [\n data.token,\n data.createdAt,\n data.expiresAt,\n data.repositorySelection,\n permissionsString,\n data.singleFileName,\n ].join(\"|\");\n await cache.set(key, value);\n}\nfunction optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {\n const permissionsString = Object.keys(permissions)\n .sort()\n .map((name) => (permissions[name] === \"read\" ? name : `${name}!`))\n .join(\",\");\n const repositoryIdsString = repositoryIds.sort().join(\",\");\n const repositoryNamesString = repositoryNames.join(\",\");\n return [\n installationId,\n repositoryIdsString,\n repositoryNamesString,\n permissionsString,\n ]\n .filter(Boolean)\n .join(\"|\");\n}\n","export function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }) {\n return Object.assign({\n type: \"token\",\n tokenType: \"installation\",\n token,\n installationId,\n permissions,\n createdAt,\n expiresAt,\n repositorySelection,\n }, repositoryIds ? { repositoryIds } : null, repositoryNames ? { repositoryNames } : null, singleFileName ? { singleFileName } : null);\n}\n","import { get, set } from \"./cache\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { toTokenAuthentication } from \"./to-token-authentication\";\nexport async function getInstallationAuthentication(state, options, customRequest) {\n const installationId = Number(options.installationId || state.installationId);\n if (!installationId) {\n throw new Error(\"[@octokit/auth-app] installationId option is required for installation authentication.\");\n }\n if (options.factory) {\n const { type, factory, oauthApp, ...factoryAuthOptions } = {\n ...state,\n ...options,\n };\n // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise>`\n return factory(factoryAuthOptions);\n }\n const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);\n if (!options.refresh) {\n const result = await get(state.cache, optionsWithInstallationTokenFromState);\n if (result) {\n const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n permissions,\n repositorySelection,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n }\n }\n const appAuthentication = await getAppAuthentication(state);\n const request = customRequest || state.request;\n const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request(\"POST /app/installations/{installation_id}/access_tokens\", {\n installation_id: installationId,\n repository_ids: options.repositoryIds,\n repositories: options.repositoryNames,\n permissions: options.permissions,\n mediaType: {\n previews: [\"machine-man\"],\n },\n headers: {\n authorization: `bearer ${appAuthentication.token}`,\n },\n });\n /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */\n const permissions = permissionsOptional || {};\n /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */\n const repositorySelection = repositorySelectionOptional || \"all\";\n const repositoryIds = repositories\n ? repositories.map((r) => r.id)\n : void 0;\n const repositoryNames = repositories\n ? repositories.map((repo) => repo.name)\n : void 0;\n const createdAt = new Date().toISOString();\n await set(state.cache, optionsWithInstallationTokenFromState, {\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n}\n","import { Deprecation } from \"deprecation\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nexport async function auth(state, authOptions) {\n switch (authOptions.type) {\n case \"app\":\n return getAppAuthentication(state);\n // @ts-expect-error \"oauth\" is not supperted in types\n case \"oauth\":\n state.log.warn(\n // @ts-expect-error `log.warn()` expects string\n new Deprecation(`[@octokit/auth-app] {type: \"oauth\"} is deprecated. Use {type: \"oauth-app\"} instead`));\n case \"oauth-app\":\n return state.oauthApp({ type: \"oauth-app\" });\n case \"installation\":\n authOptions;\n return getInstallationAuthentication(state, {\n ...authOptions,\n type: \"installation\",\n });\n case \"oauth-user\":\n // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as \"WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions\"\n return state.oauthApp(authOptions);\n default:\n // @ts-expect-error type is \"never\" at this point\n throw new Error(`Invalid auth type: ${authOptions.type}`);\n }\n}\n","const PATHS = [\n \"/app\",\n \"/app/hook/config\",\n \"/app/hook/deliveries\",\n \"/app/hook/deliveries/{delivery_id}\",\n \"/app/hook/deliveries/{delivery_id}/attempts\",\n \"/app/installations\",\n \"/app/installations/{installation_id}\",\n \"/app/installations/{installation_id}/access_tokens\",\n \"/app/installations/{installation_id}/suspended\",\n \"/marketplace_listing/accounts/{account_id}\",\n \"/marketplace_listing/plan\",\n \"/marketplace_listing/plans\",\n \"/marketplace_listing/plans/{plan_id}/accounts\",\n \"/marketplace_listing/stubbed/accounts/{account_id}\",\n \"/marketplace_listing/stubbed/plan\",\n \"/marketplace_listing/stubbed/plans\",\n \"/marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"/orgs/{org}/installation\",\n \"/repos/{owner}/{repo}/installation\",\n \"/users/{username}/installation\",\n];\n// CREDIT: Simon Grondin (https://github.com/SGrondin)\n// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js\nfunction routeMatcher(paths) {\n // EXAMPLE. For the following paths:\n /* [\n \"/orgs/{org}/invitations\",\n \"/repos/{owner}/{repo}/collaborators/{username}\"\n ] */\n const regexes = paths.map((p) => p\n .split(\"/\")\n .map((c) => (c.startsWith(\"{\") ? \"(?:.+?)\" : c))\n .join(\"/\"));\n // 'regexes' would contain:\n /* [\n '/orgs/(?:.+?)/invitations',\n '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'\n ] */\n const regex = `^(?:${regexes.map((r) => `(?:${r})`).join(\"|\")})[^/]*$`;\n // 'regex' would contain:\n /*\n ^(?:(?:\\/orgs\\/(?:.+?)\\/invitations)|(?:\\/repos\\/(?:.+?)\\/(?:.+?)\\/collaborators\\/(?:.+?)))[^\\/]*$\n \n It may look scary, but paste it into https://www.debuggex.com/\n and it will make a lot more sense!\n */\n return new RegExp(regex, \"i\");\n}\nconst REGEX = routeMatcher(PATHS);\nexport function requiresAppAuth(url) {\n return !!url && REGEX.test(url);\n}\n","import { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nimport { requiresAppAuth } from \"./requires-app-auth\";\nconst FIVE_SECONDS_IN_MS = 5 * 1000;\nfunction isNotTimeSkewError(error) {\n return !(error.message.match(/'Expiration time' claim \\('exp'\\) must be a numeric value representing the future time at which the assertion expires/) ||\n error.message.match(/'Issued at' claim \\('iat'\\) must be an Integer representing the time that the assertion was issued/));\n}\nexport async function hook(state, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n const url = endpoint.url;\n // Do not intercept request to retrieve a new token\n if (/\\/login\\/oauth\\/access_token$/.test(url)) {\n return request(endpoint);\n }\n if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, \"\"))) {\n const { token } = await getAppAuthentication(state);\n endpoint.headers.authorization = `bearer ${token}`;\n let response;\n try {\n response = await request(endpoint);\n }\n catch (error) {\n // If there's an issue with the expiration, regenerate the token and try again.\n // Otherwise rethrow the error for upstream handling.\n if (isNotTimeSkewError(error)) {\n throw error;\n }\n // If the date header is missing, we can't correct the system time skew.\n // Throw the error to be handled upstream.\n if (typeof error.response.headers.date === \"undefined\") {\n throw error;\n }\n const diff = Math.floor((Date.parse(error.response.headers.date) -\n Date.parse(new Date().toString())) /\n 1000);\n state.log.warn(error.message);\n state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);\n const { token } = await getAppAuthentication({\n ...state,\n timeDifference: diff,\n });\n endpoint.headers.authorization = `bearer ${token}`;\n return request(endpoint);\n }\n return response;\n }\n if (requiresBasicAuth(url)) {\n const authentication = await state.oauthApp({ type: \"oauth-app\" });\n endpoint.headers.authorization = authentication.headers.authorization;\n return request(endpoint);\n }\n const { token, createdAt } = await getInstallationAuthentication(state, \n // @ts-expect-error TBD\n {}, request);\n endpoint.headers.authorization = `token ${token}`;\n return sendRequestWithRetries(state, request, endpoint, createdAt);\n}\n/**\n * Newly created tokens might not be accessible immediately after creation.\n * In case of a 401 response, we retry with an exponential delay until more\n * than five seconds pass since the creation of the token.\n *\n * @see https://github.com/octokit/auth-app.js/issues/65\n */\nasync function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {\n const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);\n try {\n return await request(options);\n }\n catch (error) {\n if (error.status !== 401) {\n throw error;\n }\n if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {\n if (retries > 0) {\n error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;\n }\n throw error;\n }\n ++retries;\n const awaitTime = retries * 1000;\n state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);\n await new Promise((resolve) => setTimeout(resolve, awaitTime));\n return sendRequestWithRetries(state, request, options, createdAt, retries);\n }\n}\n","export const VERSION = \"3.6.1\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as defaultRequest } from \"@octokit/request\";\nimport { createOAuthAppAuth } from \"@octokit/auth-oauth-app\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { getCache } from \"./cache\";\nimport { VERSION } from \"./version\";\nexport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport function createAppAuth(options) {\n if (!options.appId) {\n throw new Error(\"[@octokit/auth-app] appId option is required\");\n }\n if (!options.privateKey) {\n throw new Error(\"[@octokit/auth-app] privateKey option is required\");\n }\n if (\"installationId\" in options && !options.installationId) {\n throw new Error(\"[@octokit/auth-app] installationId is set to a falsy value\");\n }\n const log = Object.assign({\n warn: console.warn.bind(console),\n }, options.log);\n const request = options.request ||\n defaultRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const state = Object.assign({\n request,\n cache: getCache(),\n }, options, options.installationId\n ? { installationId: Number(options.installationId) }\n : {}, {\n log,\n oauthApp: createOAuthAppAuth({\n clientType: \"github-app\",\n clientId: options.clientId || \"\",\n clientSecret: options.clientSecret || \"\",\n request,\n }),\n });\n // @ts-expect-error not worth the extra code to appease TS\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["getAppAuthentication","appId","privateKey","timeDifference","appAuthentication","githubAppJwt","id","now","Math","floor","Date","type","token","expiresAt","expiration","toISOString","error","Error","getCache","LRU","max","maxAge","get","cache","options","cacheKey","optionsToCacheKey","result","createdAt","repositorySelection","permissionsString","singleFileName","split","permissions","reduce","string","test","slice","repositoryIds","repositoryNames","set","data","key","Object","keys","map","name","join","value","installationId","sort","repositoryIdsString","repositoryNamesString","filter","Boolean","toTokenAuthentication","assign","tokenType","getInstallationAuthentication","state","customRequest","Number","factory","oauthApp","factoryAuthOptions","optionsWithInstallationTokenFromState","refresh","request","expires_at","repositories","permissionsOptional","repository_selection","repositorySelectionOptional","single_file","installation_id","repository_ids","mediaType","previews","headers","authorization","r","repo","auth","authOptions","log","warn","Deprecation","PATHS","routeMatcher","paths","regexes","p","c","startsWith","regex","RegExp","REGEX","requiresAppAuth","url","FIVE_SECONDS_IN_MS","isNotTimeSkewError","message","match","hook","route","parameters","endpoint","merge","replace","DEFAULTS","baseUrl","response","date","diff","parse","toString","requiresBasicAuth","authentication","sendRequestWithRetries","retries","timeSinceTokenCreationInMs","status","awaitTime","Promise","resolve","setTimeout","VERSION","createAppAuth","console","bind","defaultRequest","defaults","getUserAgent","createOAuthAppAuth","clientType","clientId","clientSecret"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACO,eAAeA,oBAAf,CAAoC;AAAEC,EAAAA,KAAF;AAASC,EAAAA,UAAT;AAAqBC,EAAAA;AAArB,CAApC,EAA4E;AAC/E,MAAI;AACA,UAAMC,iBAAiB,GAAG,MAAMC,kCAAY,CAAC;AACzCC,MAAAA,EAAE,EAAE,CAACL,KADoC;AAEzCC,MAAAA,UAFyC;AAGzCK,MAAAA,GAAG,EAAEJ,cAAc,IAAIK,IAAI,CAACC,KAAL,CAAWC,IAAI,CAACH,GAAL,KAAa,IAAxB,IAAgCJ;AAHd,KAAD,CAA5C;AAKA,WAAO;AACHQ,MAAAA,IAAI,EAAE,KADH;AAEHC,MAAAA,KAAK,EAAER,iBAAiB,CAACQ,KAFtB;AAGHX,MAAAA,KAAK,EAAEG,iBAAiB,CAACH,KAHtB;AAIHY,MAAAA,SAAS,EAAE,IAAIH,IAAJ,CAASN,iBAA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C,OAAO,CAAC2C,OAAR,IACZ+D,eAAc,CAACC,QAAf,CAAwB;AACpBrD,IAAAA,OAAO,EAAE;AACL,oBAAe,uBAAsBgD,OAAQ,IAAGM,+BAAY,EAAG;AAD1D;AADW,GAAxB,CADJ;AAMA,QAAMzE,KAAK,GAAGhB,MAAM,CAACa,MAAP,CAAc;AACxBW,aAAAA,SADwB;AAExB5C,IAAAA,KAAK,EAAEL,QAAQ;AAFS,GAAd,EAGXM,OAHW,EAGFA,OAAO,CAACyB,cAAR,GACN;AAAEA,IAAAA,cAAc,EAAEY,MAAM,CAACrC,OAAO,CAACyB,cAAT;AAAxB,GADM,GAEN,EALQ,EAKJ;AACNmC,IAAAA,GADM;AAENrB,IAAAA,QAAQ,EAAEsE,+BAAkB,CAAC;AACzBC,MAAAA,UAAU,EAAE,YADa;AAEzBC,MAAAA,QAAQ,EAAE/G,OAAO,CAAC+G,QAAR,IAAoB,EAFL;AAGzBC,MAAAA,YAAY,EAAEhH,OAAO,CAACgH,YAAR,IAAwB,EAHb;AAIzBrE,eAAAA;AAJyB,KAAD;AAFtB,GALI,CAAd,CAnBmC;;AAkCnC,SAAOxB,MAAM,CAACa,MAAP,CAAc0B,IAAI,CAAC+C,IAAL,CAAU,IAAV,EAAgBtE,KAAhB,CAAd,EAAsC;AACzC4C,IAAAA,IAAI,EAAEA,IAAI,CAAC0B,IAAL,CAAU,IAAV,EAAgBtE,KAAhB;AADmC,GAAtC,CAAP;AAGH;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-app/dist-src/auth.js b/node_modules/@octokit/auth-app/dist-src/auth.js
new file mode 100644
index 0000000..5e8f943
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/auth.js
@@ -0,0 +1,28 @@
+import { Deprecation } from "deprecation";
+import { getAppAuthentication } from "./get-app-authentication";
+import { getInstallationAuthentication } from "./get-installation-authentication";
+export async function auth(state, authOptions) {
+ switch (authOptions.type) {
+ case "app":
+ return getAppAuthentication(state);
+ // @ts-expect-error "oauth" is not supperted in types
+ case "oauth":
+ state.log.warn(
+ // @ts-expect-error `log.warn()` expects string
+ new Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`));
+ case "oauth-app":
+ return state.oauthApp({ type: "oauth-app" });
+ case "installation":
+ authOptions;
+ return getInstallationAuthentication(state, {
+ ...authOptions,
+ type: "installation",
+ });
+ case "oauth-user":
+ // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as "WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions"
+ return state.oauthApp(authOptions);
+ default:
+ // @ts-expect-error type is "never" at this point
+ throw new Error(`Invalid auth type: ${authOptions.type}`);
+ }
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/cache.js b/node_modules/@octokit/auth-app/dist-src/cache.js
new file mode 100644
index 0000000..96b085a
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/cache.js
@@ -0,0 +1,71 @@
+// https://github.com/isaacs/node-lru-cache#readme
+import LRU from "lru-cache";
+export function getCache() {
+ return new LRU({
+ // cache max. 15000 tokens, that will use less than 10mb memory
+ max: 15000,
+ // Cache for 1 minute less than GitHub expiry
+ maxAge: 1000 * 60 * 59,
+ });
+}
+export async function get(cache, options) {
+ const cacheKey = optionsToCacheKey(options);
+ const result = await cache.get(cacheKey);
+ if (!result) {
+ return;
+ }
+ const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split("|");
+ const permissions = options.permissions ||
+ permissionsString.split(/,/).reduce((permissions, string) => {
+ if (/!$/.test(string)) {
+ permissions[string.slice(0, -1)] = "write";
+ }
+ else {
+ permissions[string] = "read";
+ }
+ return permissions;
+ }, {});
+ return {
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositoryIds: options.repositoryIds,
+ repositoryNames: options.repositoryNames,
+ singleFileName,
+ repositorySelection: repositorySelection,
+ };
+}
+export async function set(cache, options, data) {
+ const key = optionsToCacheKey(options);
+ const permissionsString = options.permissions
+ ? ""
+ : Object.keys(data.permissions)
+ .map((name) => `${name}${data.permissions[name] === "write" ? "!" : ""}`)
+ .join(",");
+ const value = [
+ data.token,
+ data.createdAt,
+ data.expiresAt,
+ data.repositorySelection,
+ permissionsString,
+ data.singleFileName,
+ ].join("|");
+ await cache.set(key, value);
+}
+function optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {
+ const permissionsString = Object.keys(permissions)
+ .sort()
+ .map((name) => (permissions[name] === "read" ? name : `${name}!`))
+ .join(",");
+ const repositoryIdsString = repositoryIds.sort().join(",");
+ const repositoryNamesString = repositoryNames.join(",");
+ return [
+ installationId,
+ repositoryIdsString,
+ repositoryNamesString,
+ permissionsString,
+ ]
+ .filter(Boolean)
+ .join("|");
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/get-app-authentication.js b/node_modules/@octokit/auth-app/dist-src/get-app-authentication.js
new file mode 100644
index 0000000..77a8eb0
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/get-app-authentication.js
@@ -0,0 +1,24 @@
+import { githubAppJwt } from "universal-github-app-jwt";
+export async function getAppAuthentication({ appId, privateKey, timeDifference, }) {
+ try {
+ const appAuthentication = await githubAppJwt({
+ id: +appId,
+ privateKey,
+ now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,
+ });
+ return {
+ type: "app",
+ token: appAuthentication.token,
+ appId: appAuthentication.appId,
+ expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),
+ };
+ }
+ catch (error) {
+ if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
+ throw new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'");
+ }
+ else {
+ throw error;
+ }
+ }
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/get-installation-authentication.js b/node_modules/@octokit/auth-app/dist-src/get-installation-authentication.js
new file mode 100644
index 0000000..748d818
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/get-installation-authentication.js
@@ -0,0 +1,81 @@
+import { get, set } from "./cache";
+import { getAppAuthentication } from "./get-app-authentication";
+import { toTokenAuthentication } from "./to-token-authentication";
+export async function getInstallationAuthentication(state, options, customRequest) {
+ const installationId = Number(options.installationId || state.installationId);
+ if (!installationId) {
+ throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");
+ }
+ if (options.factory) {
+ const { type, factory, oauthApp, ...factoryAuthOptions } = {
+ ...state,
+ ...options,
+ };
+ // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise>`
+ return factory(factoryAuthOptions);
+ }
+ const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);
+ if (!options.refresh) {
+ const result = await get(state.cache, optionsWithInstallationTokenFromState);
+ if (result) {
+ const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositorySelection,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+ }
+ }
+ const appAuthentication = await getAppAuthentication(state);
+ const request = customRequest || state.request;
+ const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request("POST /app/installations/{installation_id}/access_tokens", {
+ installation_id: installationId,
+ repository_ids: options.repositoryIds,
+ repositories: options.repositoryNames,
+ permissions: options.permissions,
+ mediaType: {
+ previews: ["machine-man"],
+ },
+ headers: {
+ authorization: `bearer ${appAuthentication.token}`,
+ },
+ });
+ /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */
+ const permissions = permissionsOptional || {};
+ /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */
+ const repositorySelection = repositorySelectionOptional || "all";
+ const repositoryIds = repositories
+ ? repositories.map((r) => r.id)
+ : void 0;
+ const repositoryNames = repositories
+ ? repositories.map((repo) => repo.name)
+ : void 0;
+ const createdAt = new Date().toISOString();
+ await set(state.cache, optionsWithInstallationTokenFromState, {
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/hook.js b/node_modules/@octokit/auth-app/dist-src/hook.js
new file mode 100644
index 0000000..40aab2f
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/hook.js
@@ -0,0 +1,88 @@
+import { requiresBasicAuth } from "@octokit/auth-oauth-user";
+import { getAppAuthentication } from "./get-app-authentication";
+import { getInstallationAuthentication } from "./get-installation-authentication";
+import { requiresAppAuth } from "./requires-app-auth";
+const FIVE_SECONDS_IN_MS = 5 * 1000;
+function isNotTimeSkewError(error) {
+ return !(error.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/) ||
+ error.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/));
+}
+export async function hook(state, request, route, parameters) {
+ const endpoint = request.endpoint.merge(route, parameters);
+ const url = endpoint.url;
+ // Do not intercept request to retrieve a new token
+ if (/\/login\/oauth\/access_token$/.test(url)) {
+ return request(endpoint);
+ }
+ if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, ""))) {
+ const { token } = await getAppAuthentication(state);
+ endpoint.headers.authorization = `bearer ${token}`;
+ let response;
+ try {
+ response = await request(endpoint);
+ }
+ catch (error) {
+ // If there's an issue with the expiration, regenerate the token and try again.
+ // Otherwise rethrow the error for upstream handling.
+ if (isNotTimeSkewError(error)) {
+ throw error;
+ }
+ // If the date header is missing, we can't correct the system time skew.
+ // Throw the error to be handled upstream.
+ if (typeof error.response.headers.date === "undefined") {
+ throw error;
+ }
+ const diff = Math.floor((Date.parse(error.response.headers.date) -
+ Date.parse(new Date().toString())) /
+ 1000);
+ state.log.warn(error.message);
+ state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);
+ const { token } = await getAppAuthentication({
+ ...state,
+ timeDifference: diff,
+ });
+ endpoint.headers.authorization = `bearer ${token}`;
+ return request(endpoint);
+ }
+ return response;
+ }
+ if (requiresBasicAuth(url)) {
+ const authentication = await state.oauthApp({ type: "oauth-app" });
+ endpoint.headers.authorization = authentication.headers.authorization;
+ return request(endpoint);
+ }
+ const { token, createdAt } = await getInstallationAuthentication(state,
+ // @ts-expect-error TBD
+ {}, request);
+ endpoint.headers.authorization = `token ${token}`;
+ return sendRequestWithRetries(state, request, endpoint, createdAt);
+}
+/**
+ * Newly created tokens might not be accessible immediately after creation.
+ * In case of a 401 response, we retry with an exponential delay until more
+ * than five seconds pass since the creation of the token.
+ *
+ * @see https://github.com/octokit/auth-app.js/issues/65
+ */
+async function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {
+ const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);
+ try {
+ return await request(options);
+ }
+ catch (error) {
+ if (error.status !== 401) {
+ throw error;
+ }
+ if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {
+ if (retries > 0) {
+ error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;
+ }
+ throw error;
+ }
+ ++retries;
+ const awaitTime = retries * 1000;
+ state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);
+ await new Promise((resolve) => setTimeout(resolve, awaitTime));
+ return sendRequestWithRetries(state, request, options, createdAt, retries);
+ }
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/index.js b/node_modules/@octokit/auth-app/dist-src/index.js
new file mode 100644
index 0000000..99f1097
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/index.js
@@ -0,0 +1,46 @@
+import { getUserAgent } from "universal-user-agent";
+import { request as defaultRequest } from "@octokit/request";
+import { createOAuthAppAuth } from "@octokit/auth-oauth-app";
+import { auth } from "./auth";
+import { hook } from "./hook";
+import { getCache } from "./cache";
+import { VERSION } from "./version";
+export { createOAuthUserAuth } from "@octokit/auth-oauth-user";
+export function createAppAuth(options) {
+ if (!options.appId) {
+ throw new Error("[@octokit/auth-app] appId option is required");
+ }
+ if (!options.privateKey) {
+ throw new Error("[@octokit/auth-app] privateKey option is required");
+ }
+ if ("installationId" in options && !options.installationId) {
+ throw new Error("[@octokit/auth-app] installationId is set to a falsy value");
+ }
+ const log = Object.assign({
+ warn: console.warn.bind(console),
+ }, options.log);
+ const request = options.request ||
+ defaultRequest.defaults({
+ headers: {
+ "user-agent": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+ });
+ const state = Object.assign({
+ request,
+ cache: getCache(),
+ }, options, options.installationId
+ ? { installationId: Number(options.installationId) }
+ : {}, {
+ log,
+ oauthApp: createOAuthAppAuth({
+ clientType: "github-app",
+ clientId: options.clientId || "",
+ clientSecret: options.clientSecret || "",
+ request,
+ }),
+ });
+ // @ts-expect-error not worth the extra code to appease TS
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/requires-app-auth.js b/node_modules/@octokit/auth-app/dist-src/requires-app-auth.js
new file mode 100644
index 0000000..10c5ac7
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/requires-app-auth.js
@@ -0,0 +1,53 @@
+const PATHS = [
+ "/app",
+ "/app/hook/config",
+ "/app/hook/deliveries",
+ "/app/hook/deliveries/{delivery_id}",
+ "/app/hook/deliveries/{delivery_id}/attempts",
+ "/app/installations",
+ "/app/installations/{installation_id}",
+ "/app/installations/{installation_id}/access_tokens",
+ "/app/installations/{installation_id}/suspended",
+ "/marketplace_listing/accounts/{account_id}",
+ "/marketplace_listing/plan",
+ "/marketplace_listing/plans",
+ "/marketplace_listing/plans/{plan_id}/accounts",
+ "/marketplace_listing/stubbed/accounts/{account_id}",
+ "/marketplace_listing/stubbed/plan",
+ "/marketplace_listing/stubbed/plans",
+ "/marketplace_listing/stubbed/plans/{plan_id}/accounts",
+ "/orgs/{org}/installation",
+ "/repos/{owner}/{repo}/installation",
+ "/users/{username}/installation",
+];
+// CREDIT: Simon Grondin (https://github.com/SGrondin)
+// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js
+function routeMatcher(paths) {
+ // EXAMPLE. For the following paths:
+ /* [
+ "/orgs/{org}/invitations",
+ "/repos/{owner}/{repo}/collaborators/{username}"
+ ] */
+ const regexes = paths.map((p) => p
+ .split("/")
+ .map((c) => (c.startsWith("{") ? "(?:.+?)" : c))
+ .join("/"));
+ // 'regexes' would contain:
+ /* [
+ '/orgs/(?:.+?)/invitations',
+ '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
+ ] */
+ const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
+ // 'regex' would contain:
+ /*
+ ^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
+
+ It may look scary, but paste it into https://www.debuggex.com/
+ and it will make a lot more sense!
+ */
+ return new RegExp(regex, "i");
+}
+const REGEX = routeMatcher(PATHS);
+export function requiresAppAuth(url) {
+ return !!url && REGEX.test(url);
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/to-token-authentication.js b/node_modules/@octokit/auth-app/dist-src/to-token-authentication.js
new file mode 100644
index 0000000..5aa9a2c
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/to-token-authentication.js
@@ -0,0 +1,12 @@
+export function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }) {
+ return Object.assign({
+ type: "token",
+ tokenType: "installation",
+ token,
+ installationId,
+ permissions,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ }, repositoryIds ? { repositoryIds } : null, repositoryNames ? { repositoryNames } : null, singleFileName ? { singleFileName } : null);
+}
diff --git a/node_modules/@octokit/auth-app/dist-src/types.js b/node_modules/@octokit/auth-app/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/auth-app/dist-src/version.js b/node_modules/@octokit/auth-app/dist-src/version.js
new file mode 100644
index 0000000..7759783
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "3.6.1";
diff --git a/node_modules/@octokit/auth-app/dist-types/auth.d.ts b/node_modules/@octokit/auth-app/dist-types/auth.d.ts
new file mode 100644
index 0000000..306bbbd
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/auth.d.ts
@@ -0,0 +1,20 @@
+import * as OAuthAppAuth from "@octokit/auth-oauth-app";
+import { State, AppAuthOptions, AppAuthentication, OAuthAppAuthentication, OAuthAppAuthOptions, InstallationAuthOptions, InstallationAccessTokenAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration, OAuthWebFlowAuthOptions, OAuthDeviceFlowAuthOptions } from "./types";
+/** GitHub App authentication */
+export declare function auth(state: State, authOptions: AppAuthOptions): Promise;
+/** OAuth App authentication */
+export declare function auth(state: State, authOptions: OAuthAppAuthOptions): Promise;
+/** Installation authentication */
+export declare function auth(state: State, authOptions: InstallationAuthOptions): Promise;
+/** User Authentication via OAuth web flow */
+export declare function auth(state: State, authOptions: OAuthWebFlowAuthOptions): Promise;
+/** GitHub App Web flow with `factory` option */
+export declare function auth(state: State, authOptions: OAuthWebFlowAuthOptions & {
+ factory: OAuthAppAuth.FactoryGitHubWebFlow;
+}): Promise;
+/** User Authentication via OAuth Device flow */
+export declare function auth(state: State, authOptions: OAuthDeviceFlowAuthOptions): Promise;
+/** GitHub App Device flow with `factory` option */
+export declare function auth(state: State, authOptions: OAuthDeviceFlowAuthOptions & {
+ factory: OAuthAppAuth.FactoryGitHubDeviceFlow;
+}): Promise;
diff --git a/node_modules/@octokit/auth-app/dist-types/cache.d.ts b/node_modules/@octokit/auth-app/dist-types/cache.d.ts
new file mode 100644
index 0000000..b1d0db5
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/cache.d.ts
@@ -0,0 +1,5 @@
+import LRU from "lru-cache";
+import { InstallationAuthOptions, Cache, CacheData, InstallationAccessTokenData } from "./types";
+export declare function getCache(): LRU;
+export declare function get(cache: Cache, options: InstallationAuthOptions): Promise;
+export declare function set(cache: Cache, options: InstallationAuthOptions, data: CacheData): Promise;
diff --git a/node_modules/@octokit/auth-app/dist-types/get-app-authentication.d.ts b/node_modules/@octokit/auth-app/dist-types/get-app-authentication.d.ts
new file mode 100644
index 0000000..577db6a
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/get-app-authentication.d.ts
@@ -0,0 +1,4 @@
+import { AppAuthentication, State } from "./types";
+export declare function getAppAuthentication({ appId, privateKey, timeDifference, }: State & {
+ timeDifference?: number;
+}): Promise;
diff --git a/node_modules/@octokit/auth-app/dist-types/get-installation-authentication.d.ts b/node_modules/@octokit/auth-app/dist-types/get-installation-authentication.d.ts
new file mode 100644
index 0000000..fd9c42a
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/get-installation-authentication.d.ts
@@ -0,0 +1,2 @@
+import { InstallationAuthOptions, InstallationAccessTokenAuthentication, RequestInterface, State } from "./types";
+export declare function getInstallationAuthentication(state: State, options: InstallationAuthOptions, customRequest?: RequestInterface): Promise;
diff --git a/node_modules/@octokit/auth-app/dist-types/hook.d.ts b/node_modules/@octokit/auth-app/dist-types/hook.d.ts
new file mode 100644
index 0000000..41cc361
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/hook.d.ts
@@ -0,0 +1,2 @@
+import { AnyResponse, EndpointOptions, RequestParameters, RequestInterface, Route, State } from "./types";
+export declare function hook(state: State, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise;
diff --git a/node_modules/@octokit/auth-app/dist-types/index.d.ts b/node_modules/@octokit/auth-app/dist-types/index.d.ts
new file mode 100644
index 0000000..2a93962
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/index.d.ts
@@ -0,0 +1,4 @@
+import { AuthInterface, StrategyOptions } from "./types";
+export { createOAuthUserAuth } from "@octokit/auth-oauth-user";
+export { StrategyOptions, AppAuthOptions, OAuthAppAuthOptions, InstallationAuthOptions, OAuthWebFlowAuthOptions, OAuthDeviceFlowAuthOptions, Authentication, AppAuthentication, OAuthAppAuthentication, InstallationAccessTokenAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration, } from "./types";
+export declare function createAppAuth(options: StrategyOptions): AuthInterface;
diff --git a/node_modules/@octokit/auth-app/dist-types/requires-app-auth.d.ts b/node_modules/@octokit/auth-app/dist-types/requires-app-auth.d.ts
new file mode 100644
index 0000000..2d86d3f
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/requires-app-auth.d.ts
@@ -0,0 +1 @@
+export declare function requiresAppAuth(url: string | undefined): Boolean;
diff --git a/node_modules/@octokit/auth-app/dist-types/to-token-authentication.d.ts b/node_modules/@octokit/auth-app/dist-types/to-token-authentication.d.ts
new file mode 100644
index 0000000..b02ca30
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/to-token-authentication.d.ts
@@ -0,0 +1,2 @@
+import { CacheData, InstallationAccessTokenAuthentication, WithInstallationId } from "./types";
+export declare function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }: CacheData & WithInstallationId): InstallationAccessTokenAuthentication;
diff --git a/node_modules/@octokit/auth-app/dist-types/types.d.ts b/node_modules/@octokit/auth-app/dist-types/types.d.ts
new file mode 100644
index 0000000..c675b56
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/types.d.ts
@@ -0,0 +1,125 @@
+import * as OctokitTypes from "@octokit/types";
+import LRUCache from "lru-cache";
+import * as OAuthAppAuth from "@octokit/auth-oauth-app";
+declare type OAuthStrategyOptions = {
+ clientId?: string;
+ clientSecret?: string;
+};
+declare type CommonStrategyOptions = {
+ appId: number | string;
+ privateKey: string;
+ installationId?: number | string;
+ request?: OctokitTypes.RequestInterface;
+ cache?: Cache;
+ log?: {
+ warn: (message: string, additionalInfo?: object) => any;
+ [key: string]: any;
+ };
+};
+export declare type StrategyOptions = OAuthStrategyOptions & CommonStrategyOptions & Record;
+export declare type AppAuthOptions = {
+ type: "app";
+};
+/**
+Users SHOULD only enter repositoryIds || repositoryNames.
+However, this moduke still passes both to the backend API to
+let the API decide how to handle the logic. We just throw the
+reponse back to the client making the request.
+**/
+export declare type InstallationAuthOptions = {
+ type: "installation";
+ installationId?: number | string;
+ repositoryIds?: number[];
+ repositoryNames?: string[];
+ permissions?: Permissions;
+ refresh?: boolean;
+ factory?: never;
+ [key: string]: unknown;
+};
+export declare type InstallationAuthOptionsWithFactory = {
+ type: "installation";
+ installationId?: number | string;
+ repositoryIds?: number[];
+ repositoryNames?: string[];
+ permissions?: Permissions;
+ refresh?: boolean;
+ factory: FactoryInstallation;
+ [key: string]: unknown;
+};
+export declare type OAuthAppAuthOptions = OAuthAppAuth.AppAuthOptions;
+export declare type OAuthWebFlowAuthOptions = OAuthAppAuth.WebFlowAuthOptions;
+export declare type OAuthDeviceFlowAuthOptions = OAuthAppAuth.GitHubAppDeviceFlowAuthOptions;
+export declare type Authentication = AppAuthentication | OAuthAppAuthentication | InstallationAccessTokenAuthentication | GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration;
+export declare type FactoryInstallationOptions = StrategyOptions & Omit;
+export interface FactoryInstallation {
+ (options: FactoryInstallationOptions): T;
+}
+export interface AuthInterface {
+ (options: AppAuthOptions): Promise;
+ (options: OAuthAppAuthOptions): Promise;
+ (options: InstallationAuthOptions): Promise;
+ (options: InstallationAuthOptionsWithFactory): Promise;
+ (options: OAuthWebFlowAuthOptions): Promise;
+ (options: OAuthDeviceFlowAuthOptions): Promise;
+ (options: OAuthWebFlowAuthOptions & {
+ factory: OAuthAppAuth.FactoryGitHubWebFlow;
+ }): Promise;
+ (options: OAuthDeviceFlowAuthOptions & {
+ factory: OAuthAppAuth.FactoryGitHubDeviceFlow;
+ }): Promise;
+ hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
+}
+export declare type AnyResponse = OctokitTypes.OctokitResponse;
+export declare type EndpointDefaults = OctokitTypes.EndpointDefaults;
+export declare type EndpointOptions = OctokitTypes.EndpointOptions;
+export declare type RequestParameters = OctokitTypes.RequestParameters;
+export declare type Route = OctokitTypes.Route;
+export declare type RequestInterface = OctokitTypes.RequestInterface;
+export declare type Cache = LRUCache | {
+ get: (key: string) => string;
+ set: (key: string, value: string) => any;
+};
+export declare type APP_TYPE = "app";
+export declare type TOKEN_TYPE = "token";
+export declare type INSTALLATION_TOKEN_TYPE = "installation";
+export declare type OAUTH_TOKEN_TYPE = "oauth";
+export declare type REPOSITORY_SELECTION = "all" | "selected";
+export declare type JWT = string;
+export declare type ACCESS_TOKEN = string;
+export declare type UTC_TIMESTAMP = string;
+export declare type AppAuthentication = {
+ type: APP_TYPE;
+ token: JWT;
+ appId: number;
+ expiresAt: string;
+};
+export declare type InstallationAccessTokenData = {
+ token: ACCESS_TOKEN;
+ createdAt: UTC_TIMESTAMP;
+ expiresAt: UTC_TIMESTAMP;
+ permissions: Permissions;
+ repositorySelection: REPOSITORY_SELECTION;
+ repositoryIds?: number[];
+ repositoryNames?: string[];
+ singleFileName?: string;
+};
+export declare type CacheData = InstallationAccessTokenData;
+export declare type InstallationAccessTokenAuthentication = InstallationAccessTokenData & {
+ type: TOKEN_TYPE;
+ tokenType: INSTALLATION_TOKEN_TYPE;
+ installationId: number;
+};
+export declare type OAuthAppAuthentication = OAuthAppAuth.AppAuthentication;
+export declare type GitHubAppUserAuthentication = OAuthAppAuth.GitHubAppUserAuthentication;
+export declare type GitHubAppUserAuthenticationWithExpiration = OAuthAppAuth.GitHubAppUserAuthenticationWithExpiration;
+export declare type FactoryOptions = Required> & State;
+export declare type Permissions = Record;
+export declare type WithInstallationId = {
+ installationId: number;
+};
+export declare type State = Required> & {
+ installationId?: number;
+} & OAuthStrategyOptions & {
+ oauthApp: OAuthAppAuth.GitHubAuthInterface;
+};
+export {};
diff --git a/node_modules/@octokit/auth-app/dist-types/version.d.ts b/node_modules/@octokit/auth-app/dist-types/version.d.ts
new file mode 100644
index 0000000..86a6bbd
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "3.6.1";
diff --git a/node_modules/@octokit/auth-app/dist-web/index.js b/node_modules/@octokit/auth-app/dist-web/index.js
new file mode 100644
index 0000000..61f0969
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-web/index.js
@@ -0,0 +1,403 @@
+import { getUserAgent } from 'universal-user-agent';
+import { request } from '@octokit/request';
+import { createOAuthAppAuth } from '@octokit/auth-oauth-app';
+import { Deprecation } from 'deprecation';
+import { githubAppJwt } from 'universal-github-app-jwt';
+import LRU from 'lru-cache';
+import { requiresBasicAuth } from '@octokit/auth-oauth-user';
+export { createOAuthUserAuth } from '@octokit/auth-oauth-user';
+
+async function getAppAuthentication({ appId, privateKey, timeDifference, }) {
+ try {
+ const appAuthentication = await githubAppJwt({
+ id: +appId,
+ privateKey,
+ now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,
+ });
+ return {
+ type: "app",
+ token: appAuthentication.token,
+ appId: appAuthentication.appId,
+ expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),
+ };
+ }
+ catch (error) {
+ if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
+ throw new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'");
+ }
+ else {
+ throw error;
+ }
+ }
+}
+
+// https://github.com/isaacs/node-lru-cache#readme
+function getCache() {
+ return new LRU({
+ // cache max. 15000 tokens, that will use less than 10mb memory
+ max: 15000,
+ // Cache for 1 minute less than GitHub expiry
+ maxAge: 1000 * 60 * 59,
+ });
+}
+async function get(cache, options) {
+ const cacheKey = optionsToCacheKey(options);
+ const result = await cache.get(cacheKey);
+ if (!result) {
+ return;
+ }
+ const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split("|");
+ const permissions = options.permissions ||
+ permissionsString.split(/,/).reduce((permissions, string) => {
+ if (/!$/.test(string)) {
+ permissions[string.slice(0, -1)] = "write";
+ }
+ else {
+ permissions[string] = "read";
+ }
+ return permissions;
+ }, {});
+ return {
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositoryIds: options.repositoryIds,
+ repositoryNames: options.repositoryNames,
+ singleFileName,
+ repositorySelection: repositorySelection,
+ };
+}
+async function set(cache, options, data) {
+ const key = optionsToCacheKey(options);
+ const permissionsString = options.permissions
+ ? ""
+ : Object.keys(data.permissions)
+ .map((name) => `${name}${data.permissions[name] === "write" ? "!" : ""}`)
+ .join(",");
+ const value = [
+ data.token,
+ data.createdAt,
+ data.expiresAt,
+ data.repositorySelection,
+ permissionsString,
+ data.singleFileName,
+ ].join("|");
+ await cache.set(key, value);
+}
+function optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {
+ const permissionsString = Object.keys(permissions)
+ .sort()
+ .map((name) => (permissions[name] === "read" ? name : `${name}!`))
+ .join(",");
+ const repositoryIdsString = repositoryIds.sort().join(",");
+ const repositoryNamesString = repositoryNames.join(",");
+ return [
+ installationId,
+ repositoryIdsString,
+ repositoryNamesString,
+ permissionsString,
+ ]
+ .filter(Boolean)
+ .join("|");
+}
+
+function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }) {
+ return Object.assign({
+ type: "token",
+ tokenType: "installation",
+ token,
+ installationId,
+ permissions,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ }, repositoryIds ? { repositoryIds } : null, repositoryNames ? { repositoryNames } : null, singleFileName ? { singleFileName } : null);
+}
+
+async function getInstallationAuthentication(state, options, customRequest) {
+ const installationId = Number(options.installationId || state.installationId);
+ if (!installationId) {
+ throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");
+ }
+ if (options.factory) {
+ const { type, factory, oauthApp, ...factoryAuthOptions } = {
+ ...state,
+ ...options,
+ };
+ // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise>`
+ return factory(factoryAuthOptions);
+ }
+ const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);
+ if (!options.refresh) {
+ const result = await get(state.cache, optionsWithInstallationTokenFromState);
+ if (result) {
+ const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ permissions,
+ repositorySelection,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+ }
+ }
+ const appAuthentication = await getAppAuthentication(state);
+ const request = customRequest || state.request;
+ const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request("POST /app/installations/{installation_id}/access_tokens", {
+ installation_id: installationId,
+ repository_ids: options.repositoryIds,
+ repositories: options.repositoryNames,
+ permissions: options.permissions,
+ mediaType: {
+ previews: ["machine-man"],
+ },
+ headers: {
+ authorization: `bearer ${appAuthentication.token}`,
+ },
+ });
+ /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */
+ const permissions = permissionsOptional || {};
+ /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */
+ const repositorySelection = repositorySelectionOptional || "all";
+ const repositoryIds = repositories
+ ? repositories.map((r) => r.id)
+ : void 0;
+ const repositoryNames = repositories
+ ? repositories.map((repo) => repo.name)
+ : void 0;
+ const createdAt = new Date().toISOString();
+ await set(state.cache, optionsWithInstallationTokenFromState, {
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+ return toTokenAuthentication({
+ installationId,
+ token,
+ createdAt,
+ expiresAt,
+ repositorySelection,
+ permissions,
+ repositoryIds,
+ repositoryNames,
+ singleFileName,
+ });
+}
+
+async function auth(state, authOptions) {
+ switch (authOptions.type) {
+ case "app":
+ return getAppAuthentication(state);
+ // @ts-expect-error "oauth" is not supperted in types
+ case "oauth":
+ state.log.warn(
+ // @ts-expect-error `log.warn()` expects string
+ new Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`));
+ case "oauth-app":
+ return state.oauthApp({ type: "oauth-app" });
+ case "installation":
+ return getInstallationAuthentication(state, {
+ ...authOptions,
+ type: "installation",
+ });
+ case "oauth-user":
+ // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as "WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions"
+ return state.oauthApp(authOptions);
+ default:
+ // @ts-expect-error type is "never" at this point
+ throw new Error(`Invalid auth type: ${authOptions.type}`);
+ }
+}
+
+const PATHS = [
+ "/app",
+ "/app/hook/config",
+ "/app/hook/deliveries",
+ "/app/hook/deliveries/{delivery_id}",
+ "/app/hook/deliveries/{delivery_id}/attempts",
+ "/app/installations",
+ "/app/installations/{installation_id}",
+ "/app/installations/{installation_id}/access_tokens",
+ "/app/installations/{installation_id}/suspended",
+ "/marketplace_listing/accounts/{account_id}",
+ "/marketplace_listing/plan",
+ "/marketplace_listing/plans",
+ "/marketplace_listing/plans/{plan_id}/accounts",
+ "/marketplace_listing/stubbed/accounts/{account_id}",
+ "/marketplace_listing/stubbed/plan",
+ "/marketplace_listing/stubbed/plans",
+ "/marketplace_listing/stubbed/plans/{plan_id}/accounts",
+ "/orgs/{org}/installation",
+ "/repos/{owner}/{repo}/installation",
+ "/users/{username}/installation",
+];
+// CREDIT: Simon Grondin (https://github.com/SGrondin)
+// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js
+function routeMatcher(paths) {
+ // EXAMPLE. For the following paths:
+ /* [
+ "/orgs/{org}/invitations",
+ "/repos/{owner}/{repo}/collaborators/{username}"
+ ] */
+ const regexes = paths.map((p) => p
+ .split("/")
+ .map((c) => (c.startsWith("{") ? "(?:.+?)" : c))
+ .join("/"));
+ // 'regexes' would contain:
+ /* [
+ '/orgs/(?:.+?)/invitations',
+ '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
+ ] */
+ const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
+ // 'regex' would contain:
+ /*
+ ^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
+
+ It may look scary, but paste it into https://www.debuggex.com/
+ and it will make a lot more sense!
+ */
+ return new RegExp(regex, "i");
+}
+const REGEX = routeMatcher(PATHS);
+function requiresAppAuth(url) {
+ return !!url && REGEX.test(url);
+}
+
+const FIVE_SECONDS_IN_MS = 5 * 1000;
+function isNotTimeSkewError(error) {
+ return !(error.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/) ||
+ error.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/));
+}
+async function hook(state, request, route, parameters) {
+ const endpoint = request.endpoint.merge(route, parameters);
+ const url = endpoint.url;
+ // Do not intercept request to retrieve a new token
+ if (/\/login\/oauth\/access_token$/.test(url)) {
+ return request(endpoint);
+ }
+ if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, ""))) {
+ const { token } = await getAppAuthentication(state);
+ endpoint.headers.authorization = `bearer ${token}`;
+ let response;
+ try {
+ response = await request(endpoint);
+ }
+ catch (error) {
+ // If there's an issue with the expiration, regenerate the token and try again.
+ // Otherwise rethrow the error for upstream handling.
+ if (isNotTimeSkewError(error)) {
+ throw error;
+ }
+ // If the date header is missing, we can't correct the system time skew.
+ // Throw the error to be handled upstream.
+ if (typeof error.response.headers.date === "undefined") {
+ throw error;
+ }
+ const diff = Math.floor((Date.parse(error.response.headers.date) -
+ Date.parse(new Date().toString())) /
+ 1000);
+ state.log.warn(error.message);
+ state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);
+ const { token } = await getAppAuthentication({
+ ...state,
+ timeDifference: diff,
+ });
+ endpoint.headers.authorization = `bearer ${token}`;
+ return request(endpoint);
+ }
+ return response;
+ }
+ if (requiresBasicAuth(url)) {
+ const authentication = await state.oauthApp({ type: "oauth-app" });
+ endpoint.headers.authorization = authentication.headers.authorization;
+ return request(endpoint);
+ }
+ const { token, createdAt } = await getInstallationAuthentication(state,
+ // @ts-expect-error TBD
+ {}, request);
+ endpoint.headers.authorization = `token ${token}`;
+ return sendRequestWithRetries(state, request, endpoint, createdAt);
+}
+/**
+ * Newly created tokens might not be accessible immediately after creation.
+ * In case of a 401 response, we retry with an exponential delay until more
+ * than five seconds pass since the creation of the token.
+ *
+ * @see https://github.com/octokit/auth-app.js/issues/65
+ */
+async function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {
+ const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);
+ try {
+ return await request(options);
+ }
+ catch (error) {
+ if (error.status !== 401) {
+ throw error;
+ }
+ if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {
+ if (retries > 0) {
+ error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;
+ }
+ throw error;
+ }
+ ++retries;
+ const awaitTime = retries * 1000;
+ state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);
+ await new Promise((resolve) => setTimeout(resolve, awaitTime));
+ return sendRequestWithRetries(state, request, options, createdAt, retries);
+ }
+}
+
+const VERSION = "3.6.1";
+
+function createAppAuth(options) {
+ if (!options.appId) {
+ throw new Error("[@octokit/auth-app] appId option is required");
+ }
+ if (!options.privateKey) {
+ throw new Error("[@octokit/auth-app] privateKey option is required");
+ }
+ if ("installationId" in options && !options.installationId) {
+ throw new Error("[@octokit/auth-app] installationId is set to a falsy value");
+ }
+ const log = Object.assign({
+ warn: console.warn.bind(console),
+ }, options.log);
+ const request$1 = options.request ||
+ request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+ });
+ const state = Object.assign({
+ request: request$1,
+ cache: getCache(),
+ }, options, options.installationId
+ ? { installationId: Number(options.installationId) }
+ : {}, {
+ log,
+ oauthApp: createOAuthAppAuth({
+ clientType: "github-app",
+ clientId: options.clientId || "",
+ clientSecret: options.clientSecret || "",
+ request: request$1,
+ }),
+ });
+ // @ts-expect-error not worth the extra code to appease TS
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
+
+export { createAppAuth };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-app/dist-web/index.js.map b/node_modules/@octokit/auth-app/dist-web/index.js.map
new file mode 100644
index 0000000..979d6f2
--- /dev/null
+++ b/node_modules/@octokit/auth-app/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/get-app-authentication.js","../dist-src/cache.js","../dist-src/to-token-authentication.js","../dist-src/get-installation-authentication.js","../dist-src/auth.js","../dist-src/requires-app-auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { githubAppJwt } from \"universal-github-app-jwt\";\nexport async function getAppAuthentication({ appId, privateKey, timeDifference, }) {\n try {\n const appAuthentication = await githubAppJwt({\n id: +appId,\n privateKey,\n now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,\n });\n return {\n type: \"app\",\n token: appAuthentication.token,\n appId: appAuthentication.appId,\n expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),\n };\n }\n catch (error) {\n if (privateKey === \"-----BEGIN RSA PRIVATE KEY-----\") {\n throw new Error(\"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\\n'\");\n }\n else {\n throw error;\n }\n }\n}\n","// https://github.com/isaacs/node-lru-cache#readme\nimport LRU from \"lru-cache\";\nexport function getCache() {\n return new LRU({\n // cache max. 15000 tokens, that will use less than 10mb memory\n max: 15000,\n // Cache for 1 minute less than GitHub expiry\n maxAge: 1000 * 60 * 59,\n });\n}\nexport async function get(cache, options) {\n const cacheKey = optionsToCacheKey(options);\n const result = await cache.get(cacheKey);\n if (!result) {\n return;\n }\n const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split(\"|\");\n const permissions = options.permissions ||\n permissionsString.split(/,/).reduce((permissions, string) => {\n if (/!$/.test(string)) {\n permissions[string.slice(0, -1)] = \"write\";\n }\n else {\n permissions[string] = \"read\";\n }\n return permissions;\n }, {});\n return {\n token,\n createdAt,\n expiresAt,\n permissions,\n repositoryIds: options.repositoryIds,\n repositoryNames: options.repositoryNames,\n singleFileName,\n repositorySelection: repositorySelection,\n };\n}\nexport async function set(cache, options, data) {\n const key = optionsToCacheKey(options);\n const permissionsString = options.permissions\n ? \"\"\n : Object.keys(data.permissions)\n .map((name) => `${name}${data.permissions[name] === \"write\" ? \"!\" : \"\"}`)\n .join(\",\");\n const value = [\n data.token,\n data.createdAt,\n data.expiresAt,\n data.repositorySelection,\n permissionsString,\n data.singleFileName,\n ].join(\"|\");\n await cache.set(key, value);\n}\nfunction optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {\n const permissionsString = Object.keys(permissions)\n .sort()\n .map((name) => (permissions[name] === \"read\" ? name : `${name}!`))\n .join(\",\");\n const repositoryIdsString = repositoryIds.sort().join(\",\");\n const repositoryNamesString = repositoryNames.join(\",\");\n return [\n installationId,\n repositoryIdsString,\n repositoryNamesString,\n permissionsString,\n ]\n .filter(Boolean)\n .join(\"|\");\n}\n","export function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }) {\n return Object.assign({\n type: \"token\",\n tokenType: \"installation\",\n token,\n installationId,\n permissions,\n createdAt,\n expiresAt,\n repositorySelection,\n }, repositoryIds ? { repositoryIds } : null, repositoryNames ? { repositoryNames } : null, singleFileName ? { singleFileName } : null);\n}\n","import { get, set } from \"./cache\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { toTokenAuthentication } from \"./to-token-authentication\";\nexport async function getInstallationAuthentication(state, options, customRequest) {\n const installationId = Number(options.installationId || state.installationId);\n if (!installationId) {\n throw new Error(\"[@octokit/auth-app] installationId option is required for installation authentication.\");\n }\n if (options.factory) {\n const { type, factory, oauthApp, ...factoryAuthOptions } = {\n ...state,\n ...options,\n };\n // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise>`\n return factory(factoryAuthOptions);\n }\n const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);\n if (!options.refresh) {\n const result = await get(state.cache, optionsWithInstallationTokenFromState);\n if (result) {\n const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n permissions,\n repositorySelection,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n }\n }\n const appAuthentication = await getAppAuthentication(state);\n const request = customRequest || state.request;\n const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request(\"POST /app/installations/{installation_id}/access_tokens\", {\n installation_id: installationId,\n repository_ids: options.repositoryIds,\n repositories: options.repositoryNames,\n permissions: options.permissions,\n mediaType: {\n previews: [\"machine-man\"],\n },\n headers: {\n authorization: `bearer ${appAuthentication.token}`,\n },\n });\n /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */\n const permissions = permissionsOptional || {};\n /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */\n const repositorySelection = repositorySelectionOptional || \"all\";\n const repositoryIds = repositories\n ? repositories.map((r) => r.id)\n : void 0;\n const repositoryNames = repositories\n ? repositories.map((repo) => repo.name)\n : void 0;\n const createdAt = new Date().toISOString();\n await set(state.cache, optionsWithInstallationTokenFromState, {\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n}\n","import { Deprecation } from \"deprecation\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nexport async function auth(state, authOptions) {\n switch (authOptions.type) {\n case \"app\":\n return getAppAuthentication(state);\n // @ts-expect-error \"oauth\" is not supperted in types\n case \"oauth\":\n state.log.warn(\n // @ts-expect-error `log.warn()` expects string\n new Deprecation(`[@octokit/auth-app] {type: \"oauth\"} is deprecated. Use {type: \"oauth-app\"} instead`));\n case \"oauth-app\":\n return state.oauthApp({ type: \"oauth-app\" });\n case \"installation\":\n authOptions;\n return getInstallationAuthentication(state, {\n ...authOptions,\n type: \"installation\",\n });\n case \"oauth-user\":\n // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as \"WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions\"\n return state.oauthApp(authOptions);\n default:\n // @ts-expect-error type is \"never\" at this point\n throw new Error(`Invalid auth type: ${authOptions.type}`);\n }\n}\n","const PATHS = [\n \"/app\",\n \"/app/hook/config\",\n \"/app/hook/deliveries\",\n \"/app/hook/deliveries/{delivery_id}\",\n \"/app/hook/deliveries/{delivery_id}/attempts\",\n \"/app/installations\",\n \"/app/installations/{installation_id}\",\n \"/app/installations/{installation_id}/access_tokens\",\n \"/app/installations/{installation_id}/suspended\",\n \"/marketplace_listing/accounts/{account_id}\",\n \"/marketplace_listing/plan\",\n \"/marketplace_listing/plans\",\n \"/marketplace_listing/plans/{plan_id}/accounts\",\n \"/marketplace_listing/stubbed/accounts/{account_id}\",\n \"/marketplace_listing/stubbed/plan\",\n \"/marketplace_listing/stubbed/plans\",\n \"/marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"/orgs/{org}/installation\",\n \"/repos/{owner}/{repo}/installation\",\n \"/users/{username}/installation\",\n];\n// CREDIT: Simon Grondin (https://github.com/SGrondin)\n// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js\nfunction routeMatcher(paths) {\n // EXAMPLE. For the following paths:\n /* [\n \"/orgs/{org}/invitations\",\n \"/repos/{owner}/{repo}/collaborators/{username}\"\n ] */\n const regexes = paths.map((p) => p\n .split(\"/\")\n .map((c) => (c.startsWith(\"{\") ? \"(?:.+?)\" : c))\n .join(\"/\"));\n // 'regexes' would contain:\n /* [\n '/orgs/(?:.+?)/invitations',\n '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'\n ] */\n const regex = `^(?:${regexes.map((r) => `(?:${r})`).join(\"|\")})[^/]*$`;\n // 'regex' would contain:\n /*\n ^(?:(?:\\/orgs\\/(?:.+?)\\/invitations)|(?:\\/repos\\/(?:.+?)\\/(?:.+?)\\/collaborators\\/(?:.+?)))[^\\/]*$\n \n It may look scary, but paste it into https://www.debuggex.com/\n and it will make a lot more sense!\n */\n return new RegExp(regex, \"i\");\n}\nconst REGEX = routeMatcher(PATHS);\nexport function requiresAppAuth(url) {\n return !!url && REGEX.test(url);\n}\n","import { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nimport { requiresAppAuth } from \"./requires-app-auth\";\nconst FIVE_SECONDS_IN_MS = 5 * 1000;\nfunction isNotTimeSkewError(error) {\n return !(error.message.match(/'Expiration time' claim \\('exp'\\) must be a numeric value representing the future time at which the assertion expires/) ||\n error.message.match(/'Issued at' claim \\('iat'\\) must be an Integer representing the time that the assertion was issued/));\n}\nexport async function hook(state, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n const url = endpoint.url;\n // Do not intercept request to retrieve a new token\n if (/\\/login\\/oauth\\/access_token$/.test(url)) {\n return request(endpoint);\n }\n if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, \"\"))) {\n const { token } = await getAppAuthentication(state);\n endpoint.headers.authorization = `bearer ${token}`;\n let response;\n try {\n response = await request(endpoint);\n }\n catch (error) {\n // If there's an issue with the expiration, regenerate the token and try again.\n // Otherwise rethrow the error for upstream handling.\n if (isNotTimeSkewError(error)) {\n throw error;\n }\n // If the date header is missing, we can't correct the system time skew.\n // Throw the error to be handled upstream.\n if (typeof error.response.headers.date === \"undefined\") {\n throw error;\n }\n const diff = Math.floor((Date.parse(error.response.headers.date) -\n Date.parse(new Date().toString())) /\n 1000);\n state.log.warn(error.message);\n state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);\n const { token } = await getAppAuthentication({\n ...state,\n timeDifference: diff,\n });\n endpoint.headers.authorization = `bearer ${token}`;\n return request(endpoint);\n }\n return response;\n }\n if (requiresBasicAuth(url)) {\n const authentication = await state.oauthApp({ type: \"oauth-app\" });\n endpoint.headers.authorization = authentication.headers.authorization;\n return request(endpoint);\n }\n const { token, createdAt } = await getInstallationAuthentication(state, \n // @ts-expect-error TBD\n {}, request);\n endpoint.headers.authorization = `token ${token}`;\n return sendRequestWithRetries(state, request, endpoint, createdAt);\n}\n/**\n * Newly created tokens might not be accessible immediately after creation.\n * In case of a 401 response, we retry with an exponential delay until more\n * than five seconds pass since the creation of the token.\n *\n * @see https://github.com/octokit/auth-app.js/issues/65\n */\nasync function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {\n const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);\n try {\n return await request(options);\n }\n catch (error) {\n if (error.status !== 401) {\n throw error;\n }\n if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {\n if (retries > 0) {\n error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;\n }\n throw error;\n }\n ++retries;\n const awaitTime = retries * 1000;\n state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);\n await new Promise((resolve) => setTimeout(resolve, awaitTime));\n return sendRequestWithRetries(state, request, options, createdAt, retries);\n }\n}\n","export const VERSION = \"3.6.1\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as defaultRequest } from \"@octokit/request\";\nimport { createOAuthAppAuth } from \"@octokit/auth-oauth-app\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { getCache } from \"./cache\";\nimport { VERSION } from \"./version\";\nexport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport function createAppAuth(options) {\n if (!options.appId) {\n throw new Error(\"[@octokit/auth-app] appId option is required\");\n }\n if (!options.privateKey) {\n throw new Error(\"[@octokit/auth-app] privateKey option is required\");\n }\n if (\"installationId\" in options && !options.installationId) {\n throw new Error(\"[@octokit/auth-app] installationId is set to a falsy value\");\n }\n const log = Object.assign({\n warn: console.warn.bind(console),\n }, options.log);\n const request = options.request ||\n defaultRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const state = Object.assign({\n request,\n cache: getCache(),\n }, options, options.installationId\n ? { installationId: Number(options.installationId) }\n : {}, {\n log,\n oauthApp: createOAuthAppAuth({\n clientType: \"github-app\",\n clientId: options.clientId || \"\",\n clientSecret: options.clientSecret || \"\",\n request,\n }),\n });\n // @ts-expect-error not worth the extra code to appease TS\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["request","defaultRequest"],"mappings":";;;;;;;;;AACO,eAAe,oBAAoB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,GAAG,EAAE;AACnF,IAAI,IAAI;AACR,QAAQ,MAAM,iBAAiB,GAAG,MAAM,YAAY,CAAC;AACrD,YAAY,EAAE,EAAE,CAAC,KAAK;AACtB,YAAY,UAAU;AACtB,YAAY,GAAG,EAAE,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,cAAc;AACjF,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,KAAK;AACvB,YAAY,KAAK,EAAE,iBAAiB,CAAC,KAAK;AAC1C,YAAY,KAAK,EAAE,iBAAiB,CAAC,KAAK;AAC1C,YAAY,SAAS,EAAE,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE;AAClF,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,IAAI,UAAU,KAAK,iCAAiC,EAAE;AAC9D,YAAY,MAAM,IAAI,KAAK,CAAC,wMAAwM,CAAC,CAAC;AACtO,SAAS;AACT,aAAa;AACb,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,KAAK;AACL;;ACvBA;AACA,AACO,SAAS,QAAQ,GAAG;AAC3B,IAAI,OAAO,IAAI,GAAG,CAAC;AACnB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AAQ,EAAE,kBAAkB,CAAC;AACrC,YAAY,UAAU,EAAE,YAAY;AACpC,YAAY,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE;AAC5C,YAAY,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;AACpD,qBAAYA,SAAO;AACnB,SAAS,CAAC;AACV,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-app/package.json b/node_modules/@octokit/auth-app/package.json
new file mode 100644
index 0000000..fb4c6bb
--- /dev/null
+++ b/node_modules/@octokit/auth-app/package.json
@@ -0,0 +1,55 @@
+{
+ "name": "@octokit/auth-app",
+ "description": "GitHub App authentication for JavaScript",
+ "version": "3.6.1",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "octokit",
+ "authentication",
+ "api"
+ ],
+ "repository": "github:octokit/auth-app.js",
+ "dependencies": {
+ "@octokit/auth-oauth-app": "^4.3.0",
+ "@octokit/auth-oauth-user": "^1.2.3",
+ "@octokit/request": "^5.6.0",
+ "@octokit/request-error": "^2.1.0",
+ "@octokit/types": "^6.0.3",
+ "@types/lru-cache": "^5.1.0",
+ "deprecation": "^2.3.1",
+ "lru-cache": "^6.0.0",
+ "universal-github-app-jwt": "^1.0.1",
+ "universal-user-agent": "^6.0.0"
+ },
+ "devDependencies": {
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.0",
+ "@pika/plugin-build-web": "^0.9.0",
+ "@pika/plugin-ts-standard-pkg": "^0.9.0",
+ "@sinonjs/fake-timers": "^8.0.0",
+ "@types/fetch-mock": "^7.3.1",
+ "@types/jest": "^27.0.0",
+ "@types/sinonjs__fake-timers": "^6.0.4",
+ "fetch-mock": "^9.0.0",
+ "jest": "^27.0.0",
+ "prettier": "2.4.1",
+ "semantic-release": "^18.0.0",
+ "semantic-release-plugin-update-version-in-files": "^1.0.0",
+ "ts-jest": "^27.0.2",
+ "typescript": "^4.0.2"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/auth-oauth-app/LICENSE b/node_modules/@octokit/auth-oauth-app/LICENSE
new file mode 100644
index 0000000..ef2c18e
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2019 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@octokit/auth-oauth-app/README.md b/node_modules/@octokit/auth-oauth-app/README.md
new file mode 100644
index 0000000..27ed15b
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/README.md
@@ -0,0 +1,1054 @@
+# auth-oauth-app.js
+
+> GitHub OAuth App authentication for JavaScript
+
+[![@latest](https://img.shields.io/npm/v/@octokit/auth-oauth-app.svg)](https://www.npmjs.com/package/@octokit/auth-oauth-app)
+[![Build Status](https://github.com/octokit/auth-oauth-app.js/workflows/Test/badge.svg)](https://github.com/octokit/auth-oauth-app.js/actions?query=workflow%3ATest)
+
+`@octokit/auth-oauth-app` is implementing one of [GitHub’s authentication strategies](https://github.com/octokit/auth.js).
+
+It implements authentication using an OAuth app’s client ID and secret as well as creating user access tokens GitHub's OAuth [web application flow](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) and [device flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow).
+
+
+
+- [Standalone Usage](#standalone-usage)
+ - [Authenticate as app](#authenticate-as-app)
+ - [Authenticate user using OAuth Web Flow](#authenticate-user-using-oauth-web-flow)
+ - [Authenticate user using OAuth Device flow](#authenticate-user-using-oauth-device-flow)
+- [Usage with Octokit](#usage-with-octokit)
+- [`createOAuthAppAuth(options)` or `new Octokit({ auth })`](#createoauthappauthoptions-or-new-octokit-auth-)
+- [`auth(options)` or `octokit.auth(options)`](#authoptions-or-octokitauthoptions)
+ - [Client ID/Client Secret Basic authentication](#client-idclient-secret-basic-authentication)
+ - [OAuth web flow](#oauth-web-flow)
+ - [OAuth device flow](#oauth-device-flow)
+- [Authentication object](#authentication-object)
+ - [OAuth App authentication](#oauth-app-authentication)
+ - [OAuth user access token authentication](#oauth-user-access-token-authentication)
+ - [GitHub APP user authentication token with expiring disabled](#github-app-user-authentication-token-with-expiring-disabled)
+ - [GitHub APP user authentication token with expiring enabled](#github-app-user-authentication-token-with-expiring-enabled)
+- [`auth.hook(request, route, parameters)` or `auth.hook(request, options)`](#authhookrequest-route-parameters-or-authhookrequest-options)
+- [Types](#types)
+- [Implementation details](#implementation-details)
+- [License](#license)
+
+
+
+## Standalone Usage
+
+
+
+
+Browsers
+ |
+
+⚠️ `@octokit/auth-oauth-app` is not meant for usage in the browser. The OAuth APIs to create tokens do not have CORS enabled, and a client secret must not be exposed to the client.
+
+If you know what you are doing, load `@octokit/auth-oauth-app` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+Node
+ |
+
+Install with npm install @octokit/auth-oauth-app
+
+```js
+const { createOAuthAppAuth } = require("@octokit/auth-oauth-app");
+// or: import { createOAuthAppAuth } from "@octokit/auth-oauth-app";
+```
+
+ |
+
+
+
+### Authenticate as app
+
+```js
+const auth = createOAuthAppAuth({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const appAuthentication = await auth({
+ type: "oauth-app",
+});
+```
+
+resolves with
+
+```json
+{
+ "type": "oauth-app",
+ "clientId": "1234567890abcdef1234",
+ "clientSecret": "1234567890abcdef1234567890abcdef12345678",
+ "headers": {
+ "authorization": "basic MTIzNDU2Nzg5MGFiY2RlZjEyMzQ6MTIzNDU2Nzg5MGFiY2RlZjEyMzQ1Njc4OTBhYmNkZWYxMjM0NTY3OA=="
+ }
+}
+```
+
+### Authenticate user using OAuth Web Flow
+
+Exchange code from GitHub's OAuth web flow, see https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github
+
+```js
+const auth = createOAuthAppAuth({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuthenticationFromWebFlow = await auth({
+ type: "oauth-user",
+ code: "random123",
+ state: "mystate123",
+});
+```
+
+resolves with
+
+```json
+{
+ "clientType": "oauth-app",
+ "clientId": "1234567890abcdef1234",
+ "clientSecret": "1234567890abcdef1234567890abcdef12345678",
+ "type": "token",
+ "tokenType": "oauth",
+ "token": "useraccesstoken123",
+ "scopes": []
+}
+```
+
+### Authenticate user using OAuth Device flow
+
+Pass an asynchronous `onVerification()` method which will be called with the response from step 1 of the device flow. In that function you have to prompt the user to enter the user code at the provided verification URL.
+
+`auth()` will not resolve until the user entered the code and granted access to the app.
+
+See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github
+
+```js
+const auth = createOAuthAppAuth({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuthenticationFromDeviceFlow = await auth({
+ async onVerification(verification) {
+ // verification example
+ // {
+ // device_code: "3584d83530557fdd1f46af8289938c8ef79f9dc5",
+ // user_code: "WDJB-MJHT",
+ // verification_uri: "https://github.com/login/device",
+ // expires_in: 900,
+ // interval: 5,
+ // };
+
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+ },
+});
+```
+
+resolves with
+
+```json
+{
+ "clientType": "oauth-app",
+ "clientId": "1234567890abcdef1234",
+ "clientSecret": "1234567890abcdef1234567890abcdef12345678",
+ "type": "token",
+ "tokenType": "oauth",
+ "token": "useraccesstoken123",
+ "scopes": []
+}
+```
+
+## Usage with Octokit
+
+
+
+
+
+Browsers
+
+ |
+
+⚠️ `@octokit/auth-oauth-app` is not meant for usage in the browser. The OAuth APIs to create tokens do not have CORS enabled, and a client secret must not be exposed to the client.
+
+If you know what you are doing, load `@octokit/auth-oauth-app` and `@octokit/core` (or a compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/core @octokit/auth-oauth-app`. Optionally replace `@octokit/core` with a compatible module
+
+```js
+const { Octokit } = require("@octokit/core");
+const {
+ createOAuthAppAuth,
+ createOAuthUserAuth,
+} = require("@octokit/auth-oauth-app");
+```
+
+ |
+
+
+
+```js
+const appOctokit = new Octokit({
+ authStrategy: createOAuthAppAuth,
+ auth: {
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ },
+});
+
+// Send requests as app
+await appOctokit.request("POST /application/{client_id}/token", {
+ client_id: "1234567890abcdef1234",
+ access_token: "existingtoken123",
+});
+console.log("token is valid");
+
+// create a new octokit instance that is authenticated as the user
+const userOctokit = await appOctokit.auth({
+ type: "oauth-user",
+ code: "code123",
+ factory: (options) => {
+ return new Octokit({
+ authStrategy: createOAuthUserAuth,
+ auth: options,
+ });
+ },
+});
+
+// Exchanges the code for the user access token authentication on first request
+// and caches the authentication for successive requests
+const {
+ data: { login },
+} = await userOctokit.request("GET /user");
+console.log("Hello, %s!", login);
+```
+
+## `createOAuthAppAuth(options)` or `new Octokit({ auth })`
+
+The `createOAuthAppAuth` method accepts a single `options` object as argument. The same set of options can be passed as `auth` to the `Octokit` constructor when setting `authStrategy: createOAuthAppAuth`
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Find your OAuth app’s Client ID in your account’s developer settings.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. Find your OAuth app’s Client Secret in your account’s developer settings.
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Must be set to either "oauth-app" or "github-app" . Defaults to "oauth-app"
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+createOAuthAppAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+## `auth(options)` or `octokit.auth(options)`
+
+The async `auth()` method returned by `createOAuthAppAuth(options)` accepts different options depending on your use case
+
+### Client ID/Client Secret Basic authentication
+
+All REST API routes starting with `/applications/{client_id}` need to be authenticated using the OAuth/GitHub App's Client ID and a client secret.
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be set to "oauth-app"
+ |
+
+
+
+
+### OAuth web flow
+
+Exchange `code` for a user access token. See [Web application flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow).
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be set to "oauth-user" .
+ |
+
+
+
+ code
+ |
+
+ string
+ |
+
+ Required. The authorization code which was passed as query parameter to the callback URL from the OAuth web application flow.
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+ The URL in your application where users are sent after authorization. See redirect urls.
+ |
+
+
+
+ state
+ |
+
+ string
+ |
+
+ The unguessable random string you provided in Step 1 of the OAuth web application flow.
+ |
+
+
+
+ factory
+ |
+
+ function
+ |
+
+
+When the `factory` option is, the `auth({type: "oauth-user", code, factory })` call with resolve with whatever the `factory` function returns. The `factory` function will be called with all the strategy option that `auth` was created with, plus the additional options passed to `auth`, besides `type` and `factory`.
+
+For example, you can create a new `auth` instance for for a user using [`createOAuthUserAuth`](https://github.com/octokit/auth-oauth-user.js/#readme) which implements auto-refreshing tokens, among other features. You can import `createOAuthUserAuth` directly from `@octokit/auth-oauth-app` which will ensure compatibility.
+
+```js
+const {
+ createOAuthAppAuth,
+ createOAuthUserAuth,
+} = require("@octokit/auth-oauth-app");
+
+const appAuth = createOAuthAppAuth({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuth = await appAuth({
+ type: "oauth-user",
+ code,
+ factory: createOAuthUserAuth,
+});
+
+// will create token upon first call, then cache authentication for successive calls,
+// until token needs to be refreshed (if enabled for the GitHub App)
+const authentication = await userAuth();
+```
+
+ |
+
+
+
+
+### OAuth device flow
+
+Create a user access token without an http redirect. See [Device flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow).
+
+The device flow does not require a client secret, but it is required as strategy option for `@octokit/auth-oauth-app`, even for the device flow. If you want to implement the device flow without requiring a client secret, use [`@octokit/auth-oauth-device`](https://github.com/octokit/auth-oauth-device.js#readme).
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be set to "oauth-user" .
+ |
+
+
+
+ onVerification
+ |
+
+ function
+ |
+
+
+**Required**. A function that is called once the device and user codes were retrieved.
+
+The `onVerification()` callback can be used to pause until the user completes step 2, which might result in a better user experience.
+
+```js
+const auth = auth({
+ type: "oauth-user",
+ onVerification(verification) {
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+
+ await prompt("press enter when you are ready to continue");
+ },
+});
+```
+
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ Only relevant if the clientType strategy option is set to "oauth-app" .Array of OAuth scope names that the user access token should be granted. Defaults to no scopes ([] ).
+ |
+
+
+
+ factory
+ |
+
+ function
+ |
+
+
+When the `factory` option is, the `auth({type: "oauth-user", code, factory })` call with resolve with whatever the `factory` function returns. The `factory` function will be called with all the strategy option that `auth` was created with, plus the additional options passed to `auth`, besides `type` and `factory`.
+
+For example, you can create a new `auth` instance for for a user using [`createOAuthUserAuth`](https://github.com/octokit/auth-oauth-user.js/#readme) which implements auto-refreshing tokens, among other features. You can import `createOAuthUserAuth` directly from `@octokit/auth-oauth-app` which will ensure compatibility.
+
+```js
+const {
+ createOAuthAppAuth,
+ createOAuthUserAuth,
+} = require("@octokit/auth-oauth-app");
+
+const appAuth = createOAuthAppAuth({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+});
+
+const userAuth = await appAuth({
+ type: "oauth-user",
+ onVerification,
+ factory: createOAuthUserAuth,
+});
+
+// will create token upon first call, then cache authentication for successive calls,
+// until token needs to be refreshed (if enabled for the GitHub App)
+const authentication = await userAuth();
+```
+
+ |
+
+
+
+
+## Authentication object
+
+The async `auth(options)` method to one of four possible authentication objects
+
+1. **OAuth App authentication** for `auth({ type: "oauth-app" })`
+2. **OAuth user access token authentication** for `auth({ type: "oauth-app" })` and App is an OAuth App (OAuth user access token)
+3. **GitHub APP user authentication token with expiring disabled** for `auth({ type: "oauth-app" })` and App is a GitHub App (user-to-server token)
+4. **GitHub APP user authentication token with expiring enabled** for `auth({ type: "oauth-app" })` and App is a GitHub App (user-to-server token)
+
+### OAuth App authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "oauth-app"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The client ID as passed to the constructor.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The client secret as passed to the constructor.
+ |
+
+
+
+ headers
+ |
+
+ object
+ |
+
+ { authorization } .
+ |
+
+
+
+
+### OAuth user access token authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "oauth-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The clientId from the strategy options
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The clientSecret from the strategy options
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ array of scope names enabled for the token
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring disabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ One of the app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring enabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ One of the app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ The refresh token
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+
+## `auth.hook(request, route, parameters)` or `auth.hook(request, options)`
+
+`auth.hook()` hooks directly into the request life cycle. It amends the request to authenticate correctly using `clientId` and `clientSecret` as basic auth for the API endpoints that support it. It throws an error in other cases.
+
+The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The `route`/`options` parameters are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
+
+`auth.hook()` can be called directly to send an authenticated request
+
+```js
+const { data: user } = await auth.hook(
+ request,
+ "POST /applications/{client_id}/token",
+ {
+ client_id: "1234567890abcdef1234",
+ access_token: "token123",
+ }
+);
+```
+
+Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
+
+```js
+const requestWithAuth = request.defaults({
+ request: {
+ hook: auth.hook,
+ },
+});
+
+const { data: user } = await requestWithAuth(
+ "POST /applications/{client_id}/token",
+ {
+ client_id: "1234567890abcdef1234",
+ access_token: "token123",
+ }
+);
+```
+
+## Types
+
+```ts
+import {
+ // strategy options
+ OAuthAppStrategyOptions,
+ GitHubAppStrategyOptions,
+ // auth options
+ AppAuthOptions,
+ WebFlowAuthOptions,
+ OAuthAppDeviceFlowAuthOptions,
+ GitHubAppDeviceFlowAuthOptions,
+ // auth interfaces
+ OAuthAppAuthInterface,
+ GitHubAuthInterface,
+ // authentication object
+ AppAuthentication,
+ OAuthAppUserAuthentication,
+ GitHubAppUserAuthentication,
+ GitHubAppUserAuthenticationWithExpiration,
+} from "@octokit/auth-oauth-app";
+```
+
+## Implementation details
+
+Client ID and secret can be passed as Basic auth in the `Authorization` header in order to get a higher rate limit compared to unauthenticated requests. This is meant for the use on servers only: never expose an OAuth client secret on a client such as a web application!
+
+`auth.hook` will set the correct authentication header automatically based on the request URL. For all [OAuth Application endpoints](https://developer.github.com/v3/apps/oauth_applications/), the `Authorization` header is set to basic auth. For all other endpoints and token is retrieved and used in the `Authorization` header. The token is cached and used for succeeding requests.
+
+To reset the cached access token, you can do this
+
+```js
+const { token } = await auth({ type: "oauth-user" });
+await auth.hook(request, "POST /applications/{client_id}/token", {
+ client_id: "1234567890abcdef1234",
+ access_token: token,
+});
+```
+
+The internally cached token will be replaced and used for succeeding requests. See also ["the REST API documentation"](https://developer.github.com/v3/oauth_authorizations/).
+
+See also: [octokit/oauth-authorization-url.js](https://github.com/octokit/oauth-authorization-url.js).
+
+## License
+
+[MIT](LICENSE)
+
+```
+
+```
diff --git a/node_modules/@octokit/auth-oauth-app/dist-node/index.js b/node_modules/@octokit/auth-oauth-app/dist-node/index.js
new file mode 100644
index 0000000..bbf56dd
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-node/index.js
@@ -0,0 +1,186 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
+
+var universalUserAgent = require('universal-user-agent');
+var request = require('@octokit/request');
+var btoa = _interopDefault(require('btoa-lite'));
+var authOauthUser = require('@octokit/auth-oauth-user');
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+
+ if (enumerableOnly) {
+ symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ }
+
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+
+ var key, i;
+
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+const _excluded = ["type"];
+async function auth(state, authOptions) {
+ if (authOptions.type === "oauth-app") {
+ return {
+ type: "oauth-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ headers: {
+ authorization: `basic ${btoa(`${state.clientId}:${state.clientSecret}`)}`
+ }
+ };
+ }
+
+ if ("factory" in authOptions) {
+ const _authOptions$state = _objectSpread2(_objectSpread2({}, authOptions), state),
+ options = _objectWithoutProperties(_authOptions$state, _excluded); // @ts-expect-error TODO: `option` cannot be never, is this a bug?
+
+
+ return authOptions.factory(options);
+ }
+
+ const common = _objectSpread2({
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ request: state.request
+ }, authOptions); // TS: Look what you made me do
+
+
+ const userAuth = state.clientType === "oauth-app" ? await authOauthUser.createOAuthUserAuth(_objectSpread2(_objectSpread2({}, common), {}, {
+ clientType: state.clientType
+ })) : await authOauthUser.createOAuthUserAuth(_objectSpread2(_objectSpread2({}, common), {}, {
+ clientType: state.clientType
+ }));
+ return userAuth();
+}
+
+async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters); // Do not intercept OAuth Web/Device flow request
+
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+
+ if (state.clientType === "github-app" && !authOauthUser.requiresBasicAuth(endpoint.url)) {
+ throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${endpoint.method} ${endpoint.url}" is not supported.`);
+ }
+
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+
+ try {
+ return await request(endpoint);
+ } catch (error) {
+ /* istanbul ignore if */
+ if (error.status !== 401) throw error;
+ error.message = `[@octokit/auth-oauth-app] "${endpoint.method} ${endpoint.url}" does not support clientId/clientSecret basic authentication.`;
+ throw error;
+ }
+}
+
+const VERSION = "4.3.0";
+
+function createOAuthAppAuth(options) {
+ const state = Object.assign({
+ request: request.request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
+ }
+ }),
+ clientType: "oauth-app"
+ }, options); // @ts-expect-error not worth the extra code to appease TS
+
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state)
+ });
+}
+
+Object.defineProperty(exports, 'createOAuthUserAuth', {
+ enumerable: true,
+ get: function () {
+ return authOauthUser.createOAuthUserAuth;
+ }
+});
+exports.createOAuthAppAuth = createOAuthAppAuth;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-app/dist-node/index.js.map b/node_modules/@octokit/auth-oauth-app/dist-node/index.js.map
new file mode 100644
index 0000000..3f367e2
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import btoa from \"btoa-lite\";\nimport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport async function auth(state, authOptions) {\n if (authOptions.type === \"oauth-app\") {\n return {\n type: \"oauth-app\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n headers: {\n authorization: `basic ${btoa(`${state.clientId}:${state.clientSecret}`)}`,\n },\n };\n }\n if (\"factory\" in authOptions) {\n const { type, ...options } = {\n ...authOptions,\n ...state,\n };\n // @ts-expect-error TODO: `option` cannot be never, is this a bug?\n return authOptions.factory(options);\n }\n const common = {\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n request: state.request,\n ...authOptions,\n };\n // TS: Look what you made me do\n const userAuth = state.clientType === \"oauth-app\"\n ? await createOAuthUserAuth({\n ...common,\n clientType: state.clientType,\n })\n : await createOAuthUserAuth({\n ...common,\n clientType: state.clientType,\n });\n return userAuth();\n}\n","import btoa from \"btoa-lite\";\nimport { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept OAuth Web/Device flow request\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n if (state.clientType === \"github-app\" && !requiresBasicAuth(endpoint.url)) {\n throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than \"/applications/{client_id}/**\". \"${endpoint.method} ${endpoint.url}\" is not supported.`);\n }\n const credentials = btoa(`${state.clientId}:${state.clientSecret}`);\n endpoint.headers.authorization = `basic ${credentials}`;\n try {\n return await request(endpoint);\n }\n catch (error) {\n /* istanbul ignore if */\n if (error.status !== 401)\n throw error;\n error.message = `[@octokit/auth-oauth-app] \"${endpoint.method} ${endpoint.url}\" does not support clientId/clientSecret basic authentication.`;\n throw error;\n }\n}\n","export const VERSION = \"4.3.0\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport function createOAuthAppAuth(options) {\n const state = Object.assign({\n request: request.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,\n },\n }),\n clientType: \"oauth-app\",\n }, options);\n // @ts-expect-error not worth the extra code to appease TS\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["auth","state","authOptions","type","clientId","clientSecret","clientType","headers","authorization","btoa","options","factory","common","request","userAuth","createOAuthUserAuth","hook","route","parameters","endpoint","merge","test","url","requiresBasicAuth","Error","method","credentials","error","status","message","VERSION","createOAuthAppAuth","Object","assign","defaults","getUserAgent","bind"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,eAAeA,IAAf,CAAoBC,KAApB,EAA2BC,WAA3B,EAAwC;AAC3C,MAAIA,WAAW,CAACC,IAAZ,KAAqB,WAAzB,EAAsC;AAClC,WAAO;AACHA,MAAAA,IAAI,EAAE,WADH;AAEHC,MAAAA,QAAQ,EAAEH,KAAK,CAACG,QAFb;AAGHC,MAAAA,YAAY,EAAEJ,KAAK,CAACI,YAHjB;AAIHC,MAAAA,UAAU,EAAEL,KAAK,CAACK,UAJf;AAKHC,MAAAA,OAAO,EAAE;AACLC,QAAAA,aAAa,EAAG,SAAQC,IAAI,CAAE,GAAER,KAAK,CAACG,QAAS,IAAGH,KAAK,CAACI,YAAa,EAAzC,CAA4C;AADnE;AALN,KAAP;AASH;;AACD,MAAI,aAAaH,WAAjB,EAA8B;AAC1B,iEACOA,WADP,GAEOD,KAFP;AAAA,UAAiBS,OAAjB,2DAD0B;;;AAM1B,WAAOR,WAAW,CAACS,OAAZ,CAAoBD,OAApB,CAAP;AACH;;AACD,QAAME,MAAM;AACRR,IAAAA,QAAQ,EAAEH,KAAK,CAACG,QADR;AAERC,IAAAA,YAAY,EAAEJ,KAAK,CAACI,YAFZ;AAGRQ,IAAAA,OAAO,EAAEZ,KAAK,CAACY;AAHP,KAILX,WAJK,CAAZ,CApB2C;;;AA2B3C,QAAMY,QAAQ,GAAGb,KAAK,CAACK,UAAN,KAAqB,WAArB,GACX,MAAMS,iCAAmB,mCACpBH,MADoB;AAEvBN,IAAAA,UAAU,EAAEL,KAAK,CAACK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,GAAG+B,MAAM,CAACC,MAAP,CAAc;AACxBpB,IAAAA,OAAO,EAAEA,eAAO,CAACqB,QAAR,CAAiB;AACtB3B,MAAAA,OAAO,EAAE;AACL,sBAAe,6BAA4BuB,OAAQ,IAAGK,+BAAY,EAAG;AADhE;AADa,KAAjB,CADe;AAMxB7B,IAAAA,UAAU,EAAE;AANY,GAAd,EAOXI,OAPW,CAAd,CADwC;;AAUxC,SAAOsB,MAAM,CAACC,MAAP,CAAcjC,IAAI,CAACoC,IAAL,CAAU,IAAV,EAAgBnC,KAAhB,CAAd,EAAsC;AACzCe,IAAAA,IAAI,EAAEA,IAAI,CAACoB,IAAL,CAAU,IAAV,EAAgBnC,KAAhB;AADmC,GAAtC,CAAP;AAGH;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-app/dist-src/auth.js b/node_modules/@octokit/auth-oauth-app/dist-src/auth.js
new file mode 100644
index 0000000..23c4e60
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-src/auth.js
@@ -0,0 +1,40 @@
+import btoa from "btoa-lite";
+import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
+export async function auth(state, authOptions) {
+ if (authOptions.type === "oauth-app") {
+ return {
+ type: "oauth-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ headers: {
+ authorization: `basic ${btoa(`${state.clientId}:${state.clientSecret}`)}`,
+ },
+ };
+ }
+ if ("factory" in authOptions) {
+ const { type, ...options } = {
+ ...authOptions,
+ ...state,
+ };
+ // @ts-expect-error TODO: `option` cannot be never, is this a bug?
+ return authOptions.factory(options);
+ }
+ const common = {
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ request: state.request,
+ ...authOptions,
+ };
+ // TS: Look what you made me do
+ const userAuth = state.clientType === "oauth-app"
+ ? await createOAuthUserAuth({
+ ...common,
+ clientType: state.clientType,
+ })
+ : await createOAuthUserAuth({
+ ...common,
+ clientType: state.clientType,
+ });
+ return userAuth();
+}
diff --git a/node_modules/@octokit/auth-oauth-app/dist-src/hook.js b/node_modules/@octokit/auth-oauth-app/dist-src/hook.js
new file mode 100644
index 0000000..6c0c848
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-src/hook.js
@@ -0,0 +1,24 @@
+import btoa from "btoa-lite";
+import { requiresBasicAuth } from "@octokit/auth-oauth-user";
+export async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept OAuth Web/Device flow request
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ if (state.clientType === "github-app" && !requiresBasicAuth(endpoint.url)) {
+ throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${endpoint.method} ${endpoint.url}" is not supported.`);
+ }
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+ try {
+ return await request(endpoint);
+ }
+ catch (error) {
+ /* istanbul ignore if */
+ if (error.status !== 401)
+ throw error;
+ error.message = `[@octokit/auth-oauth-app] "${endpoint.method} ${endpoint.url}" does not support clientId/clientSecret basic authentication.`;
+ throw error;
+ }
+}
diff --git a/node_modules/@octokit/auth-oauth-app/dist-src/index.js b/node_modules/@octokit/auth-oauth-app/dist-src/index.js
new file mode 100644
index 0000000..4eeb7be
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-src/index.js
@@ -0,0 +1,20 @@
+import { getUserAgent } from "universal-user-agent";
+import { request } from "@octokit/request";
+import { auth } from "./auth";
+import { hook } from "./hook";
+import { VERSION } from "./version";
+export { createOAuthUserAuth } from "@octokit/auth-oauth-user";
+export function createOAuthAppAuth(options) {
+ const state = Object.assign({
+ request: request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+ }),
+ clientType: "oauth-app",
+ }, options);
+ // @ts-expect-error not worth the extra code to appease TS
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
diff --git a/node_modules/@octokit/auth-oauth-app/dist-src/types.js b/node_modules/@octokit/auth-oauth-app/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/auth-oauth-app/dist-src/version.js b/node_modules/@octokit/auth-oauth-app/dist-src/version.js
new file mode 100644
index 0000000..d5116f3
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "4.3.0";
diff --git a/node_modules/@octokit/auth-oauth-app/dist-types/auth.d.ts b/node_modules/@octokit/auth-oauth-app/dist-types/auth.d.ts
new file mode 100644
index 0000000..7180962
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-types/auth.d.ts
@@ -0,0 +1,18 @@
+import { OAuthAppState, GitHubAppState, AppAuthOptions, WebFlowAuthOptions, OAuthAppDeviceFlowAuthOptions, GitHubAppDeviceFlowAuthOptions, FactoryOAuthAppWebFlow, FactoryOAuthAppDeviceFlow, FactoryGitHubWebFlow, FactoryGitHubDeviceFlow, AppAuthentication, OAuthAppUserAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration } from "./types";
+export declare function auth(state: OAuthAppState | GitHubAppState, authOptions: AppAuthOptions): Promise;
+export declare function auth(state: OAuthAppState, authOptions: WebFlowAuthOptions): Promise;
+export declare function auth(state: OAuthAppState, authOptions: WebFlowAuthOptions & {
+ factory: FactoryOAuthAppWebFlow;
+}): Promise;
+export declare function auth(state: OAuthAppState, authOptions: OAuthAppDeviceFlowAuthOptions): Promise;
+export declare function auth(state: OAuthAppState, authOptions: OAuthAppDeviceFlowAuthOptions & {
+ factory: FactoryOAuthAppDeviceFlow;
+}): Promise;
+export declare function auth(state: GitHubAppState, authOptions: WebFlowAuthOptions): Promise;
+export declare function auth(state: GitHubAppState, authOptions: WebFlowAuthOptions & {
+ factory: FactoryGitHubWebFlow;
+}): Promise;
+export declare function auth(state: GitHubAppState, authOptions: GitHubAppDeviceFlowAuthOptions): Promise;
+export declare function auth(state: GitHubAppState, authOptions: GitHubAppDeviceFlowAuthOptions & {
+ factory: FactoryGitHubDeviceFlow;
+}): Promise;
diff --git a/node_modules/@octokit/auth-oauth-app/dist-types/hook.d.ts b/node_modules/@octokit/auth-oauth-app/dist-types/hook.d.ts
new file mode 100644
index 0000000..12fdfa2
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-types/hook.d.ts
@@ -0,0 +1,3 @@
+import { EndpointOptions, RequestParameters, Route, RequestInterface, OctokitResponse } from "@octokit/types";
+import { OAuthAppState, GitHubAppState } from "./types";
+export declare function hook(state: OAuthAppState | GitHubAppState, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
diff --git a/node_modules/@octokit/auth-oauth-app/dist-types/index.d.ts b/node_modules/@octokit/auth-oauth-app/dist-types/index.d.ts
new file mode 100644
index 0000000..68ba65a
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-types/index.d.ts
@@ -0,0 +1,5 @@
+import { OAuthAppStrategyOptions, GitHubAppStrategyOptions, OAuthAppAuthInterface, GitHubAuthInterface } from "./types";
+export { OAuthAppStrategyOptions, GitHubAppStrategyOptions, AppAuthOptions, WebFlowAuthOptions, OAuthAppDeviceFlowAuthOptions, GitHubAppDeviceFlowAuthOptions, OAuthAppAuthInterface, GitHubAuthInterface, AppAuthentication, OAuthAppUserAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration, FactoryGitHubWebFlow, FactoryGitHubDeviceFlow, } from "./types";
+export { createOAuthUserAuth } from "@octokit/auth-oauth-user";
+export declare function createOAuthAppAuth(options: OAuthAppStrategyOptions): OAuthAppAuthInterface;
+export declare function createOAuthAppAuth(options: GitHubAppStrategyOptions): GitHubAuthInterface;
diff --git a/node_modules/@octokit/auth-oauth-app/dist-types/types.d.ts b/node_modules/@octokit/auth-oauth-app/dist-types/types.d.ts
new file mode 100644
index 0000000..adee6f3
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-types/types.d.ts
@@ -0,0 +1,102 @@
+import { EndpointOptions, RequestParameters, Route, RequestInterface, OctokitResponse } from "@octokit/types";
+import * as AuthOAuthUser from "@octokit/auth-oauth-user";
+import * as DeviceTypes from "@octokit/auth-oauth-device";
+export declare type ClientType = "oauth-app" | "github-app";
+export declare type OAuthAppStrategyOptions = {
+ clientType?: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ request?: RequestInterface;
+};
+export declare type GitHubAppStrategyOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ request?: RequestInterface;
+};
+export declare type AppAuthOptions = {
+ type: "oauth-app";
+};
+export declare type WebFlowAuthOptions = {
+ type: "oauth-user";
+ code: string;
+ redirectUrl?: string;
+ state?: string;
+};
+export declare type OAuthAppDeviceFlowAuthOptions = {
+ type: "oauth-user";
+ onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
+ scopes?: string[];
+};
+export declare type GitHubAppDeviceFlowAuthOptions = {
+ type: "oauth-user";
+ onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
+};
+export declare type AppAuthentication = {
+ type: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ clientType: ClientType;
+ headers: {
+ authorization: string;
+ };
+};
+export declare type OAuthAppUserAuthentication = AuthOAuthUser.OAuthAppAuthentication;
+export declare type GitHubAppUserAuthentication = AuthOAuthUser.GitHubAppAuthentication;
+export declare type GitHubAppUserAuthenticationWithExpiration = AuthOAuthUser.GitHubAppAuthenticationWithExpiration;
+export declare type FactoryOAuthAppWebFlowOptions = OAuthAppStrategyOptions & Omit & {
+ clientType: "oauth-app";
+};
+export declare type FactoryOAuthAppDeviceFlowOptions = OAuthAppStrategyOptions & Omit & {
+ clientType: "oauth-app";
+};
+export declare type FactoryGitHubAppWebFlowOptions = GitHubAppStrategyOptions & Omit & {
+ clientType: "github-app";
+};
+export declare type FactoryGitHubAppDeviceFlowOptions = GitHubAppStrategyOptions & Omit & {
+ clientType: "github-app";
+};
+export interface FactoryOAuthAppWebFlow {
+ (options: FactoryOAuthAppWebFlowOptions): T;
+}
+export interface FactoryOAuthAppDeviceFlow {
+ (options: FactoryOAuthAppDeviceFlowOptions): T;
+}
+export interface FactoryGitHubWebFlow {
+ (options: FactoryGitHubAppWebFlowOptions): T;
+}
+export interface FactoryGitHubDeviceFlow {
+ (options: FactoryGitHubAppDeviceFlowOptions): T;
+}
+export interface OAuthAppAuthInterface {
+ (options: AppAuthOptions): Promise;
+ (options: WebFlowAuthOptions & {
+ factory: FactoryOAuthAppWebFlow;
+ }): Promise;
+ (options: OAuthAppDeviceFlowAuthOptions & {
+ factory: FactoryOAuthAppDeviceFlow;
+ }): Promise;
+ (options: WebFlowAuthOptions): Promise;
+ (options: OAuthAppDeviceFlowAuthOptions): Promise;
+ hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
+}
+export interface GitHubAuthInterface {
+ (options?: AppAuthOptions): Promise;
+ (options: WebFlowAuthOptions & {
+ factory: FactoryGitHubWebFlow;
+ }): Promise;
+ (options: GitHubAppDeviceFlowAuthOptions & {
+ factory: FactoryGitHubDeviceFlow;
+ }): Promise;
+ (options?: WebFlowAuthOptions): Promise;
+ (options?: GitHubAppDeviceFlowAuthOptions): Promise;
+ hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
+}
+export declare type OAuthAppState = OAuthAppStrategyOptions & {
+ clientType: "oauth-app";
+ request: RequestInterface;
+};
+export declare type GitHubAppState = GitHubAppStrategyOptions & {
+ clientType: "github-app";
+ request: RequestInterface;
+};
diff --git a/node_modules/@octokit/auth-oauth-app/dist-types/version.d.ts b/node_modules/@octokit/auth-oauth-app/dist-types/version.d.ts
new file mode 100644
index 0000000..511e0de
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "4.3.0";
diff --git a/node_modules/@octokit/auth-oauth-app/dist-web/index.js b/node_modules/@octokit/auth-oauth-app/dist-web/index.js
new file mode 100644
index 0000000..4dfbf89
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-web/index.js
@@ -0,0 +1,87 @@
+import { getUserAgent } from 'universal-user-agent';
+import { request } from '@octokit/request';
+import btoa from 'btoa-lite';
+import { createOAuthUserAuth, requiresBasicAuth } from '@octokit/auth-oauth-user';
+export { createOAuthUserAuth } from '@octokit/auth-oauth-user';
+
+async function auth(state, authOptions) {
+ if (authOptions.type === "oauth-app") {
+ return {
+ type: "oauth-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ headers: {
+ authorization: `basic ${btoa(`${state.clientId}:${state.clientSecret}`)}`,
+ },
+ };
+ }
+ if ("factory" in authOptions) {
+ const { type, ...options } = {
+ ...authOptions,
+ ...state,
+ };
+ // @ts-expect-error TODO: `option` cannot be never, is this a bug?
+ return authOptions.factory(options);
+ }
+ const common = {
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ request: state.request,
+ ...authOptions,
+ };
+ // TS: Look what you made me do
+ const userAuth = state.clientType === "oauth-app"
+ ? await createOAuthUserAuth({
+ ...common,
+ clientType: state.clientType,
+ })
+ : await createOAuthUserAuth({
+ ...common,
+ clientType: state.clientType,
+ });
+ return userAuth();
+}
+
+async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept OAuth Web/Device flow request
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ if (state.clientType === "github-app" && !requiresBasicAuth(endpoint.url)) {
+ throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${endpoint.method} ${endpoint.url}" is not supported.`);
+ }
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+ try {
+ return await request(endpoint);
+ }
+ catch (error) {
+ /* istanbul ignore if */
+ if (error.status !== 401)
+ throw error;
+ error.message = `[@octokit/auth-oauth-app] "${endpoint.method} ${endpoint.url}" does not support clientId/clientSecret basic authentication.`;
+ throw error;
+ }
+}
+
+const VERSION = "4.3.0";
+
+function createOAuthAppAuth(options) {
+ const state = Object.assign({
+ request: request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+ }),
+ clientType: "oauth-app",
+ }, options);
+ // @ts-expect-error not worth the extra code to appease TS
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
+
+export { createOAuthAppAuth };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-app/dist-web/index.js.map b/node_modules/@octokit/auth-oauth-app/dist-web/index.js.map
new file mode 100644
index 0000000..fe377a3
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import btoa from \"btoa-lite\";\nimport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport async function auth(state, authOptions) {\n if (authOptions.type === \"oauth-app\") {\n return {\n type: \"oauth-app\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n headers: {\n authorization: `basic ${btoa(`${state.clientId}:${state.clientSecret}`)}`,\n },\n };\n }\n if (\"factory\" in authOptions) {\n const { type, ...options } = {\n ...authOptions,\n ...state,\n };\n // @ts-expect-error TODO: `option` cannot be never, is this a bug?\n return authOptions.factory(options);\n }\n const common = {\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n request: state.request,\n ...authOptions,\n };\n // TS: Look what you made me do\n const userAuth = state.clientType === \"oauth-app\"\n ? await createOAuthUserAuth({\n ...common,\n clientType: state.clientType,\n })\n : await createOAuthUserAuth({\n ...common,\n clientType: state.clientType,\n });\n return userAuth();\n}\n","import btoa from \"btoa-lite\";\nimport { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept OAuth Web/Device flow request\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n if (state.clientType === \"github-app\" && !requiresBasicAuth(endpoint.url)) {\n throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than \"/applications/{client_id}/**\". \"${endpoint.method} ${endpoint.url}\" is not supported.`);\n }\n const credentials = btoa(`${state.clientId}:${state.clientSecret}`);\n endpoint.headers.authorization = `basic ${credentials}`;\n try {\n return await request(endpoint);\n }\n catch (error) {\n /* istanbul ignore if */\n if (error.status !== 401)\n throw error;\n error.message = `[@octokit/auth-oauth-app] \"${endpoint.method} ${endpoint.url}\" does not support clientId/clientSecret basic authentication.`;\n throw error;\n }\n}\n","export const VERSION = \"4.3.0\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport function createOAuthAppAuth(options) {\n const state = Object.assign({\n request: request.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,\n },\n }),\n clientType: \"oauth-app\",\n }, options);\n // @ts-expect-error not worth the extra code to appease TS\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":[],"mappings":";;;;;;AAEO,eAAe,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE;AAC/C,IAAI,IAAI,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,mBAAmB,CAAC;;ACMpC,SAAS,kBAAkB,CAAC,OAAO,EAAE;AAC5C,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AAChC,QAAQ,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;AAClC,YAAY,OAAO,EAAE;AACrB,gBAAgB,YAAY,EAAE,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AACtF,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,UAAU,EAAE,WAAW;AAC/B,KAAK,EAAE,OAAO,CAAC,CAAC;AAChB;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-app/package.json b/node_modules/@octokit/auth-oauth-app/package.json
new file mode 100644
index 0000000..8b3c943
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-app/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@octokit/auth-oauth-app",
+ "description": "GitHub OAuth App authentication for JavaScript",
+ "version": "4.3.0",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "octokit",
+ "authentication",
+ "oauth",
+ "api"
+ ],
+ "repository": "github:octokit/auth-oauth-app.js",
+ "dependencies": {
+ "@octokit/auth-oauth-device": "^3.1.1",
+ "@octokit/auth-oauth-user": "^1.2.1",
+ "@octokit/request": "^5.3.0",
+ "@octokit/types": "^6.0.3",
+ "@types/btoa-lite": "^1.0.0",
+ "btoa-lite": "^1.0.0",
+ "universal-user-agent": "^6.0.0"
+ },
+ "devDependencies": {
+ "@octokit/core": "^3.3.1",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.0",
+ "@pika/plugin-build-web": "^0.9.0",
+ "@pika/plugin-ts-standard-pkg": "^0.9.0",
+ "@types/fetch-mock": "^7.3.1",
+ "@types/jest": "^26.0.0",
+ "fetch-mock": "^9.0.0",
+ "jest": "^27.0.0",
+ "prettier": "^2.2.1",
+ "semantic-release": "^17.0.0",
+ "semantic-release-plugin-update-version-in-files": "^1.0.0",
+ "ts-jest": "^27.0.0-next.12",
+ "typescript": "^4.0.0"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/auth-oauth-device/LICENSE b/node_modules/@octokit/auth-oauth-device/LICENSE
new file mode 100644
index 0000000..57049d0
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/LICENSE
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) 2021 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@octokit/auth-oauth-device/README.md b/node_modules/@octokit/auth-oauth-device/README.md
new file mode 100644
index 0000000..2fbe50d
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/README.md
@@ -0,0 +1,656 @@
+# auth-oauth-device.js
+
+> GitHub OAuth Device authentication strategy for JavaScript
+
+[![@latest](https://img.shields.io/npm/v/@octokit/auth-oauth-device.svg)](https://www.npmjs.com/package/@octokit/auth-oauth-device)
+[![Build Status](https://github.com/octokit/auth-oauth-device.js/workflows/Test/badge.svg)](https://github.com/octokit/auth-oauth-device.js/actions?query=workflow%3ATest+branch%3Amain)
+
+`@octokit/auth-oauth-device` is implementing one of [GitHub’s OAuth Device Flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow).
+
+
+
+- [Usage](#usage)
+ - [For OAuth Apps](#for-oauth-apps)
+ - [For GitHub Apps](#for-github-apps)
+- [`createOAuthDeviceAuth(options)`](#createoauthdeviceauthoptions)
+- [`auth(options)`](#authoptions)
+- [Authentication object](#authentication-object)
+ - [OAuth APP user authentication](#oauth-app-user-authentication)
+ - [GitHub APP user authentication with expiring tokens disabled](#github-app-user-authentication-with-expiring-tokens-disabled)
+ - [GitHub APP user authentication with expiring tokens enabled](#github-app-user-authentication-with-expiring-tokens-enabled)
+- [`auth.hook(request, route, parameters)` or `auth.hook(request, options)`](#authhookrequest-route-parameters-or-authhookrequest-options)
+- [Types](#types)
+- [How it works](#how-it-works)
+- [Contributing](#contributing)
+- [License](#license)
+
+
+
+## Usage
+
+
+
+
+
+Browsers
+
+ |
+
+Load `@octokit/auth-oauth-device` directly from [cdn.pika.dev](https://cdn.pika.dev)
+
+```html
+
+```
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/core @octokit/auth-oauth-device`
+
+```js
+const { createOAuthDeviceAuth } = require("@octokit/auth-oauth-device");
+```
+
+ |
+
+
+
+### For OAuth Apps
+
+```js
+const auth = createOAuthDeviceAuth({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["public_repo"],
+ onVerification(verification) {
+ // verification example
+ // {
+ // device_code: "3584d83530557fdd1f46af8289938c8ef79f9dc5",
+ // user_code: "WDJB-MJHT",
+ // verification_uri: "https://github.com/login/device",
+ // expires_in: 900,
+ // interval: 5,
+ // };
+
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+ },
+});
+
+const tokenAuthentication = await auth({
+ type: "oauth",
+});
+// resolves with
+// {
+// type: "token",
+// tokenType: "oauth",
+// clientType: "oauth-app",
+// clientId: "1234567890abcdef1234",
+// token: "...", /* the created oauth token */
+// scopes: [] /* depend on request scopes by OAuth app */
+// }
+```
+
+### For GitHub Apps
+
+GitHub Apps do not support `scopes`. Client IDs of GitHub Apps have a `lv1.` prefix. If the GitHub App has expiring user tokens enabled, the resulting `authentication` object has extra properties related to expiration and refreshing the token.
+
+```js
+const auth = createOAuthDeviceAuth({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ onVerification(verification) {
+ // verification example
+ // {
+ // device_code: "3584d83530557fdd1f46af8289938c8ef79f9dc5",
+ // user_code: "WDJB-MJHT",
+ // verification_uri: "https://github.com/login/device",
+ // expires_in: 900,
+ // interval: 5,
+ // };
+
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+ },
+});
+
+const tokenAuthentication = await auth({
+ type: "oauth",
+});
+// resolves with
+// {
+// type: "token",
+// tokenType: "oauth",
+// clientType: "github-app",
+// clientId: "lv1.1234567890abcdef",
+// token: "...", /* the created oauth token */
+// }
+// or if expiring user tokens are enabled
+// {
+// type: "token",
+// tokenType: "oauth",
+// clientType: "github-app",
+// clientId: "lv1.1234567890abcdef",
+// token: "...", /* the created oauth token */
+// refreshToken: "...",
+// expiresAt: "2022-01-01T08:00:0.000Z",
+// refreshTokenExpiresAt: "2021-07-01T00:00:0.000Z",
+// }
+```
+
+## `createOAuthDeviceAuth(options)`
+
+The `createOAuthDeviceAuth` method accepts a single `options` parameter
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Find your OAuth app’s Client ID in your account’s developer settings.
+ |
+
+
+
+ onVerification
+ |
+
+ function
+ |
+
+ Required. A function that is called once the device and user codes were retrieved
+
+The `onVerification()` callback can be used to pause until the user completes step 2, which might result in a better user experience.
+
+```js
+const auth = createOAuthDeviceAuth({
+ clientId: "1234567890abcdef1234",
+ onVerification(verification) {
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+
+ await prompt("press enter when you are ready to continue");
+ },
+});
+```
+
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+
+Must be either `oauth-app` or `github-app`. Defaults to `oauth-app`.
+
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+createOAuthDeviceAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "secret",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+
+Only relavant if `clientType` is set to `"oauth-app"`.
+
+Array of scope names enabled for the token. Defaults to `[]`. See [available scopes](https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes).
+
+ |
+
+
+
+
+## `auth(options)`
+
+The async `auth()` method returned by `createOAuthDeviceAuth(options)` accepts the following options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ Required. Must be set to "oauth"
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+
+Only relevant if the `clientType` strategy options was set to `"oauth-app"`
+
+Array of scope names enabled for the token. Defaults to what was set in the [strategy options](#createoauthdeviceauthoptions). See available scopes
+
+ |
+
+
+
+ refresh
+ |
+
+ boolean
+ |
+
+
+Defaults to `false`. When set to `false`, calling `auth(options)` will resolve with a token that was previously created for the same scopes if it exists. If set to `true` a new token will always be created.
+
+ |
+
+
+
+
+## Authentication object
+
+The async `auth(options)` method resolves to one of three possible objects
+
+1. OAuth APP user authentication
+1. GitHub APP user authentication with expiring tokens disabled
+1. GitHub APP user authentication with expiring tokens enabled
+
+The differences are
+
+1. `scopes` is only present for OAuth Apps
+2. `refreshToken`, `expiresAt`, `refreshTokenExpiresAt` are only present for GitHub Apps, and only if token expiration is enabled
+
+### OAuth APP user authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The personal access token
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ array of scope names enabled for the token
+ |
+
+
+
+
+### GitHub APP user authentication with expiring tokens disabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The personal access token
+ |
+
+
+
+
+### GitHub APP user authentication with expiring tokens enabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ The refresh token
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+
+## `auth.hook(request, route, parameters)` or `auth.hook(request, options)`
+
+`auth.hook()` hooks directly into the request life cycle. It amends the request to authenticate correctly based on the request URL.
+
+The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The `route`/`options` parameters are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
+
+`auth.hook()` can be called directly to send an authenticated request
+
+```js
+const { data: user } = await auth.hook(request, "GET /user");
+```
+
+Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
+
+```js
+const requestWithAuth = request.defaults({
+ request: {
+ hook: auth.hook,
+ },
+});
+
+const { data: user } = await requestWithAuth("GET /user");
+```
+
+## Types
+
+```ts
+import {
+ OAuthAppStrategyOptions,
+ OAuthAppAuthOptions,
+ OAuthAppAuthentication,
+ GitHubAppStrategyOptions,
+ GitHubAppAuthOptions,
+ GitHubAppAuthentication,
+ GitHubAppAuthenticationWithExpiration,
+} from "@octokit/auth-oauth-device";
+```
+
+## How it works
+
+GitHub's OAuth Device flow is different from the web flow in two ways
+
+1. It does not require a URL redirect, which makes it great for devices and CLI apps
+2. It does not require the OAuth client secret, which means there is no user-owned server component required.
+
+The flow has 3 parts (see [GitHub documentation](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow))
+
+1. `@octokit/auth-oauth-device` requests a device and user code
+2. Then the user has to open https://github.com/login/device (or it's GitHub Enterprise Server equivalent) and enter the user code
+3. While the user enters the code, `@octokit/auth-oauth-device` is sending requests in the background to retrieve the OAuth access token. Once the user completed step 2, the request will succeed and the token will be returned
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md)
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/auth-oauth-device/dist-node/index.js b/node_modules/@octokit/auth-oauth-device/dist-node/index.js
new file mode 100644
index 0000000..30f72b7
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-node/index.js
@@ -0,0 +1,241 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var universalUserAgent = require('universal-user-agent');
+var request = require('@octokit/request');
+var oauthMethods = require('@octokit/oauth-methods');
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+
+ if (enumerableOnly) {
+ symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ }
+
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+
+ var key, i;
+
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+async function getOAuthAccessToken(state, options) {
+ const cachedAuthentication = getCachedAuthentication(state, options.auth);
+ if (cachedAuthentication) return cachedAuthentication; // Step 1: Request device and user codes
+ // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github
+
+ const {
+ data: verification
+ } = await oauthMethods.createDeviceCode({
+ clientType: state.clientType,
+ clientId: state.clientId,
+ request: options.request || state.request,
+ // @ts-expect-error the extra code to make TS happy is not worth it
+ scopes: options.auth.scopes || state.scopes
+ }); // Step 2: User must enter the user code on https://github.com/login/device
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser
+
+ await state.onVerification(verification); // Step 3: Exchange device code for access token
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device
+
+ const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);
+ state.authentication = authentication;
+ return authentication;
+}
+
+function getCachedAuthentication(state, auth) {
+ if (auth.refresh === true) return false;
+ if (!state.authentication) return false;
+
+ if (state.clientType === "github-app") {
+ return state.authentication;
+ }
+
+ const authentication = state.authentication;
+ const newScope = ("scopes" in auth && auth.scopes || state.scopes).join(" ");
+ const currentScope = authentication.scopes.join(" ");
+ return newScope === currentScope ? authentication : false;
+}
+
+async function wait(seconds) {
+ await new Promise(resolve => setTimeout(resolve, seconds * 1000));
+}
+
+async function waitForAccessToken(request, clientId, clientType, verification) {
+ try {
+ const options = {
+ clientId,
+ request,
+ code: verification.device_code
+ }; // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME
+
+ const {
+ authentication
+ } = clientType === "oauth-app" ? await oauthMethods.exchangeDeviceCode(_objectSpread2(_objectSpread2({}, options), {}, {
+ clientType: "oauth-app"
+ })) : await oauthMethods.exchangeDeviceCode(_objectSpread2(_objectSpread2({}, options), {}, {
+ clientType: "github-app"
+ }));
+ return _objectSpread2({
+ type: "token",
+ tokenType: "oauth"
+ }, authentication);
+ } catch (error) {
+ // istanbul ignore if
+ if (!error.response) throw error;
+ const errorType = error.response.data.error;
+
+ if (errorType === "authorization_pending") {
+ await wait(verification.interval);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+
+ if (errorType === "slow_down") {
+ await wait(verification.interval + 5);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+
+ throw error;
+ }
+}
+
+async function auth(state, authOptions) {
+ return getOAuthAccessToken(state, {
+ auth: authOptions
+ });
+}
+
+async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters); // Do not intercept request to retrieve codes or token
+
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+
+ const {
+ token
+ } = await getOAuthAccessToken(state, {
+ request,
+ auth: {
+ type: "oauth"
+ }
+ });
+ endpoint.headers.authorization = `token ${token}`;
+ return request(endpoint);
+}
+
+const VERSION = "3.1.2";
+
+function createOAuthDeviceAuth(options) {
+ const requestWithDefaults = options.request || request.request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-device.js/${VERSION} ${universalUserAgent.getUserAgent()}`
+ }
+ });
+
+ const {
+ request: request$1 = requestWithDefaults
+ } = options,
+ otherOptions = _objectWithoutProperties(options, ["request"]);
+
+ const state = options.clientType === "github-app" ? _objectSpread2(_objectSpread2({}, otherOptions), {}, {
+ clientType: "github-app",
+ request: request$1
+ }) : _objectSpread2(_objectSpread2({}, otherOptions), {}, {
+ clientType: "oauth-app",
+ request: request$1,
+ scopes: options.scopes || []
+ });
+
+ if (!options.clientId) {
+ throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');
+ }
+
+ if (!options.onVerification) {
+ throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');
+ } // @ts-ignore too much for tsc / ts-jest ¯\_(ツ)_/¯
+
+
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state)
+ });
+}
+
+exports.createOAuthDeviceAuth = createOAuthDeviceAuth;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-device/dist-node/index.js.map b/node_modules/@octokit/auth-oauth-device/dist-node/index.js.map
new file mode 100644
index 0000000..bc5598d
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n if (!error.response)\n throw error;\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"3.1.2\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["getOAuthAccessToken","state","options","cachedAuthentication","getCachedAuthentication","auth","data","verification","createDeviceCode","clientType","clientId","request","scopes","onVerification","authentication","waitForAccessToken","refresh","newScope","join","currentScope","wait","seconds","Promise","resolve","setTimeout","code","device_code","exchangeDeviceCode","type","tokenType","error","response","errorType","interval","authOptions","hook","route","parameters","endpoint","merge","test","url","token","headers","authorization","VERSION","createOAuthDeviceAuth","requestWithDefaults","octokitRequest","defaults","getUserAgent","otherOptions","Error","Object","assign","bind"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAAA,OAAO,EAAE;AACL,oBAAe,gCAA+BE,OAAQ,IAAGK,+BAAY,EAAG;AADnE;AADW,GAAxB,CADJ;;AAMA,QAAM;AAAEvC,aAAAA,SAAO,GAAGoC;AAAZ,MAAqD7C,OAA3D;AAAA,QAA0CiD,YAA1C,4BAA2DjD,OAA3D;;AACA,QAAMD,KAAK,GAAGC,OAAO,CAACO,UAAR,KAAuB,YAAvB,qCAEH0C,YAFG;AAGN1C,IAAAA,UAAU,EAAE,YAHN;AAINE,aAAAA;AAJM,yCAOHwC,YAPG;AAQN1C,IAAAA,UAAU,EAAE,WARN;AASNE,aAAAA,SATM;AAUNC,IAAAA,MAAM,EAAEV,OAAO,CAACU,MAAR,IAAkB;AAVpB,IAAd;;AAYA,MAAI,CAACV,OAAO,CAACQ,QAAb,EAAuB;AACnB,UAAM,IAAI0C,KAAJ,CAAU,oHAAV,CAAN;AACH;;AACD,MAAI,CAAClD,OAAO,CAACW,cAAb,EAA6B;AACzB,UAAM,IAAIuC,KAAJ,CAAU,iIAAV,CAAN;AACH,GAzB0C;;;AA2B3C,SAAOC,MAAM,CAACC,MAAP,CAAcjD,IAAI,CAACkD,IAAL,CAAU,IAAV,EAAgBtD,KAAhB,CAAd,EAAsC;AACzCkC,IAAAA,IAAI,EAAEA,IAAI,CAACoB,IAAL,CAAU,IAAV,EAAgBtD,KAAhB;AADmC,GAAtC,CAAP;AAGH;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/auth.js b/node_modules/@octokit/auth-oauth-device/dist-src/auth.js
new file mode 100644
index 0000000..f62e980
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/auth.js
@@ -0,0 +1,6 @@
+import { getOAuthAccessToken } from "./get-oauth-access-token";
+export async function auth(state, authOptions) {
+ return getOAuthAccessToken(state, {
+ auth: authOptions,
+ });
+}
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/get-oauth-access-token.js b/node_modules/@octokit/auth-oauth-device/dist-src/get-oauth-access-token.js
new file mode 100644
index 0000000..b72a786
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/get-oauth-access-token.js
@@ -0,0 +1,78 @@
+import { createDeviceCode, exchangeDeviceCode } from "@octokit/oauth-methods";
+export async function getOAuthAccessToken(state, options) {
+ const cachedAuthentication = getCachedAuthentication(state, options.auth);
+ if (cachedAuthentication)
+ return cachedAuthentication;
+ // Step 1: Request device and user codes
+ // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github
+ const { data: verification } = await createDeviceCode({
+ clientType: state.clientType,
+ clientId: state.clientId,
+ request: options.request || state.request,
+ // @ts-expect-error the extra code to make TS happy is not worth it
+ scopes: options.auth.scopes || state.scopes,
+ });
+ // Step 2: User must enter the user code on https://github.com/login/device
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser
+ await state.onVerification(verification);
+ // Step 3: Exchange device code for access token
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device
+ const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);
+ state.authentication = authentication;
+ return authentication;
+}
+function getCachedAuthentication(state, auth) {
+ if (auth.refresh === true)
+ return false;
+ if (!state.authentication)
+ return false;
+ if (state.clientType === "github-app") {
+ return state.authentication;
+ }
+ const authentication = state.authentication;
+ const newScope = (("scopes" in auth && auth.scopes) || state.scopes).join(" ");
+ const currentScope = authentication.scopes.join(" ");
+ return newScope === currentScope ? authentication : false;
+}
+async function wait(seconds) {
+ await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
+}
+async function waitForAccessToken(request, clientId, clientType, verification) {
+ try {
+ const options = {
+ clientId,
+ request,
+ code: verification.device_code,
+ };
+ // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME
+ const { authentication } = clientType === "oauth-app"
+ ? await exchangeDeviceCode({
+ ...options,
+ clientType: "oauth-app",
+ })
+ : await exchangeDeviceCode({
+ ...options,
+ clientType: "github-app",
+ });
+ return {
+ type: "token",
+ tokenType: "oauth",
+ ...authentication,
+ };
+ }
+ catch (error) {
+ // istanbul ignore if
+ if (!error.response)
+ throw error;
+ const errorType = error.response.data.error;
+ if (errorType === "authorization_pending") {
+ await wait(verification.interval);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+ if (errorType === "slow_down") {
+ await wait(verification.interval + 5);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+ throw error;
+ }
+}
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/hook.js b/node_modules/@octokit/auth-oauth-device/dist-src/hook.js
new file mode 100644
index 0000000..76f9a55
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/hook.js
@@ -0,0 +1,14 @@
+import { getOAuthAccessToken } from "./get-oauth-access-token";
+export async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept request to retrieve codes or token
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ const { token } = await getOAuthAccessToken(state, {
+ request,
+ auth: { type: "oauth" },
+ });
+ endpoint.headers.authorization = `token ${token}`;
+ return request(endpoint);
+}
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/index.js b/node_modules/@octokit/auth-oauth-device/dist-src/index.js
new file mode 100644
index 0000000..b9e6980
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/index.js
@@ -0,0 +1,36 @@
+import { getUserAgent } from "universal-user-agent";
+import { request as octokitRequest } from "@octokit/request";
+import { auth } from "./auth";
+import { hook } from "./hook";
+import { VERSION } from "./version";
+export function createOAuthDeviceAuth(options) {
+ const requestWithDefaults = options.request ||
+ octokitRequest.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,
+ },
+ });
+ const { request = requestWithDefaults, ...otherOptions } = options;
+ const state = options.clientType === "github-app"
+ ? {
+ ...otherOptions,
+ clientType: "github-app",
+ request,
+ }
+ : {
+ ...otherOptions,
+ clientType: "oauth-app",
+ request,
+ scopes: options.scopes || [],
+ };
+ if (!options.clientId) {
+ throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');
+ }
+ if (!options.onVerification) {
+ throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');
+ }
+ // @ts-ignore too much for tsc / ts-jest ¯\_(ツ)_/¯
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/types.js b/node_modules/@octokit/auth-oauth-device/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/auth-oauth-device/dist-src/version.js b/node_modules/@octokit/auth-oauth-device/dist-src/version.js
new file mode 100644
index 0000000..cff7ee8
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "3.1.2";
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/auth.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/auth.d.ts
new file mode 100644
index 0000000..935ab95
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/auth.d.ts
@@ -0,0 +1,2 @@
+import { OAuthAppAuthOptions, GitHubAppAuthOptions, OAuthAppAuthentication, GitHubAppAuthentication, OAuthAppState, GitHubAppState } from "./types";
+export declare function auth(state: OAuthAppState | GitHubAppState, authOptions: OAuthAppAuthOptions | GitHubAppAuthOptions): Promise;
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/get-oauth-access-token.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/get-oauth-access-token.d.ts
new file mode 100644
index 0000000..2bbe941
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/get-oauth-access-token.d.ts
@@ -0,0 +1,6 @@
+import { RequestInterface } from "@octokit/types";
+import { OAuthAppState, GitHubAppState, OAuthAppAuthOptions, GitHubAppAuthOptions, OAuthAppAuthentication, GitHubAppAuthentication } from "./types";
+export declare function getOAuthAccessToken(state: OAuthAppState | GitHubAppState, options: {
+ request?: RequestInterface;
+ auth: OAuthAppAuthOptions | GitHubAppAuthOptions;
+}): Promise;
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/hook.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/hook.d.ts
new file mode 100644
index 0000000..f9803e4
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/hook.d.ts
@@ -0,0 +1,3 @@
+import { RequestInterface, OctokitResponse, EndpointOptions, RequestParameters, Route } from "@octokit/types";
+import { OAuthAppState, GitHubAppState } from "./types";
+export declare function hook(state: OAuthAppState | GitHubAppState, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/index.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/index.d.ts
new file mode 100644
index 0000000..4b1b734
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/index.d.ts
@@ -0,0 +1,4 @@
+import { GitHubAppAuthInterface, GitHubAppStrategyOptions, OAuthAppAuthInterface, OAuthAppStrategyOptions } from "./types";
+export { OAuthAppStrategyOptions, OAuthAppAuthOptions, OAuthAppAuthentication, GitHubAppStrategyOptions, GitHubAppAuthOptions, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, } from "./types";
+export declare function createOAuthDeviceAuth(options: OAuthAppStrategyOptions): OAuthAppAuthInterface;
+export declare function createOAuthDeviceAuth(options: GitHubAppStrategyOptions): GitHubAppAuthInterface;
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/types.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/types.d.ts
new file mode 100644
index 0000000..951dbab
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/types.d.ts
@@ -0,0 +1,68 @@
+import { RequestInterface, Route, EndpointOptions, RequestParameters, OctokitResponse } from "@octokit/types";
+import * as OAuthMethodsTypes from "@octokit/oauth-methods";
+export declare type ClientType = "oauth-app" | "github-app";
+export declare type OAuthAppStrategyOptions = {
+ clientId: string;
+ clientType?: "oauth-app";
+ onVerification: OnVerificationCallback;
+ scopes?: string[];
+ request?: RequestInterface;
+};
+export declare type GitHubAppStrategyOptions = {
+ clientId: string;
+ clientType: "github-app";
+ onVerification: OnVerificationCallback;
+ request?: RequestInterface;
+};
+export interface OAuthAppAuthInterface {
+ (options: OAuthAppAuthOptions): Promise;
+ hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
+}
+export interface GitHubAppAuthInterface {
+ (options: GitHubAppAuthOptions): Promise;
+ hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise>;
+}
+export declare type OAuthAppAuthOptions = {
+ type: "oauth";
+ scopes?: string[];
+ refresh?: boolean;
+};
+export declare type GitHubAppAuthOptions = {
+ type: "oauth";
+ refresh?: boolean;
+};
+export declare type OAuthAppAuthentication = {
+ type: "token";
+ tokenType: "oauth";
+} & Omit;
+export declare type GitHubAppAuthentication = {
+ type: "token";
+ tokenType: "oauth";
+} & Omit;
+export declare type GitHubAppAuthenticationWithExpiration = {
+ type: "token";
+ tokenType: "oauth";
+} & Omit;
+export declare type Verification = {
+ device_code: string;
+ user_code: string;
+ verification_uri: string;
+ expires_in: number;
+ interval: number;
+};
+export declare type OnVerificationCallback = (verification: Verification) => any | Promise;
+export declare type OAuthAppState = {
+ clientId: string;
+ clientType: "oauth-app";
+ onVerification: OnVerificationCallback;
+ scopes: string[];
+ request: RequestInterface;
+ authentication?: OAuthAppAuthentication;
+};
+export declare type GitHubAppState = {
+ clientId: string;
+ clientType: "github-app";
+ onVerification: OnVerificationCallback;
+ request: RequestInterface;
+ authentication?: GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration;
+};
diff --git a/node_modules/@octokit/auth-oauth-device/dist-types/version.d.ts b/node_modules/@octokit/auth-oauth-device/dist-types/version.d.ts
new file mode 100644
index 0000000..31e9409
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "3.1.2";
diff --git a/node_modules/@octokit/auth-oauth-device/dist-web/index.js b/node_modules/@octokit/auth-oauth-device/dist-web/index.js
new file mode 100644
index 0000000..08f5a93
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-web/index.js
@@ -0,0 +1,138 @@
+import { getUserAgent } from 'universal-user-agent';
+import { request } from '@octokit/request';
+import { createDeviceCode, exchangeDeviceCode } from '@octokit/oauth-methods';
+
+async function getOAuthAccessToken(state, options) {
+ const cachedAuthentication = getCachedAuthentication(state, options.auth);
+ if (cachedAuthentication)
+ return cachedAuthentication;
+ // Step 1: Request device and user codes
+ // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github
+ const { data: verification } = await createDeviceCode({
+ clientType: state.clientType,
+ clientId: state.clientId,
+ request: options.request || state.request,
+ // @ts-expect-error the extra code to make TS happy is not worth it
+ scopes: options.auth.scopes || state.scopes,
+ });
+ // Step 2: User must enter the user code on https://github.com/login/device
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser
+ await state.onVerification(verification);
+ // Step 3: Exchange device code for access token
+ // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device
+ const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);
+ state.authentication = authentication;
+ return authentication;
+}
+function getCachedAuthentication(state, auth) {
+ if (auth.refresh === true)
+ return false;
+ if (!state.authentication)
+ return false;
+ if (state.clientType === "github-app") {
+ return state.authentication;
+ }
+ const authentication = state.authentication;
+ const newScope = (("scopes" in auth && auth.scopes) || state.scopes).join(" ");
+ const currentScope = authentication.scopes.join(" ");
+ return newScope === currentScope ? authentication : false;
+}
+async function wait(seconds) {
+ await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
+}
+async function waitForAccessToken(request, clientId, clientType, verification) {
+ try {
+ const options = {
+ clientId,
+ request,
+ code: verification.device_code,
+ };
+ // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME
+ const { authentication } = clientType === "oauth-app"
+ ? await exchangeDeviceCode({
+ ...options,
+ clientType: "oauth-app",
+ })
+ : await exchangeDeviceCode({
+ ...options,
+ clientType: "github-app",
+ });
+ return {
+ type: "token",
+ tokenType: "oauth",
+ ...authentication,
+ };
+ }
+ catch (error) {
+ // istanbul ignore if
+ if (!error.response)
+ throw error;
+ const errorType = error.response.data.error;
+ if (errorType === "authorization_pending") {
+ await wait(verification.interval);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+ if (errorType === "slow_down") {
+ await wait(verification.interval + 5);
+ return waitForAccessToken(request, clientId, clientType, verification);
+ }
+ throw error;
+ }
+}
+
+async function auth(state, authOptions) {
+ return getOAuthAccessToken(state, {
+ auth: authOptions,
+ });
+}
+
+async function hook(state, request, route, parameters) {
+ let endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept request to retrieve codes or token
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ const { token } = await getOAuthAccessToken(state, {
+ request,
+ auth: { type: "oauth" },
+ });
+ endpoint.headers.authorization = `token ${token}`;
+ return request(endpoint);
+}
+
+const VERSION = "3.1.2";
+
+function createOAuthDeviceAuth(options) {
+ const requestWithDefaults = options.request ||
+ request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,
+ },
+ });
+ const { request: request$1 = requestWithDefaults, ...otherOptions } = options;
+ const state = options.clientType === "github-app"
+ ? {
+ ...otherOptions,
+ clientType: "github-app",
+ request: request$1,
+ }
+ : {
+ ...otherOptions,
+ clientType: "oauth-app",
+ request: request$1,
+ scopes: options.scopes || [],
+ };
+ if (!options.clientId) {
+ throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');
+ }
+ if (!options.onVerification) {
+ throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');
+ }
+ // @ts-ignore too much for tsc / ts-jest ¯\_(ツ)_/¯
+ return Object.assign(auth.bind(null, state), {
+ hook: hook.bind(null, state),
+ });
+}
+
+export { createOAuthDeviceAuth };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-device/dist-web/index.js.map b/node_modules/@octokit/auth-oauth-device/dist-web/index.js.map
new file mode 100644
index 0000000..e6f2ea5
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n if (!error.response)\n throw error;\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"3.1.2\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["octokitRequest","request"],"mappings":";;;;AACO,eAAe,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE;AAC1D,IAAI,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9E,IAAI,IAAI,oBAAoB;AAC5B,QAAQ,OAAO,oBAAoB,CAAC;AACpC;AACA;AACA,IAAI,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,gBAAgB,CAAC;AAC1D,QAAQ,UAAU,EAAE,KAAK,CAAC,UAAU;AACpC,QAAQ,QAAQ,EAAE,KAAK,CAAC,QAAQ;AAChC,QAAQ,OAAO,EAAE,OAAO,CAAC,OAAO,I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AY,EAAE,CAAC,CAAC;AACzF,aAAa;AACb,SAAS,CAAC,CAAC;AACX,IAAI,MAAM,WAAEC,SAAO,GAAG,mBAAmB,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;AACvE,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,KAAK,YAAY;AACrD,UAAU;AACV,YAAY,GAAG,YAAY;AAC3B,YAAY,UAAU,EAAE,YAAY;AACpC,qBAAYA,SAAO;AACnB,SAAS;AACT,UAAU;AACV,YAAY,GAAG,YAAY;AAC3B,YAAY,UAAU,EAAE,WAAW;AACnC,qBAAYA,SAAO;AACnB,YAAY,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;AACxC,SAAS,CAAC;AACV,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,KAAK,CAAC,oHAAoH,CAAC,CAAC;AAC9I,KAAK;AACL,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,iIAAiI,CAAC,CAAC;AAC3J,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-device/package.json b/node_modules/@octokit/auth-oauth-device/package.json
new file mode 100644
index 0000000..a989f89
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-device/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "@octokit/auth-oauth-device",
+ "description": "GitHub OAuth Device authentication strategy for JavaScript",
+ "version": "3.1.2",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "api",
+ "sdk",
+ "toolkit"
+ ],
+ "repository": "github:octokit/auth-oauth-device.js",
+ "dependencies": {
+ "@octokit/oauth-methods": "^1.1.0",
+ "@octokit/request": "^5.4.14",
+ "@octokit/types": "^6.10.0",
+ "universal-user-agent": "^6.0.0"
+ },
+ "peerDependencies": {},
+ "devDependencies": {
+ "@octokit/tsconfig": "^1.0.2",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.2",
+ "@pika/plugin-build-web": "^0.9.2",
+ "@pika/plugin-ts-standard-pkg": "^0.9.2",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^14.14.31",
+ "fetch-mock": "^9.11.0",
+ "jest": "^26.6.3",
+ "prettier": "^2.2.1",
+ "semantic-release": "^17.3.9",
+ "semantic-release-plugin-update-version-in-files": "^1.1.0",
+ "ts-jest": "^26.5.2",
+ "typescript": "^4.2.2"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/auth-oauth-user/LICENSE b/node_modules/@octokit/auth-oauth-user/LICENSE
new file mode 100644
index 0000000..57049d0
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/LICENSE
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) 2021 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@octokit/auth-oauth-user/README.md b/node_modules/@octokit/auth-oauth-user/README.md
new file mode 100644
index 0000000..5215668
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/README.md
@@ -0,0 +1,1010 @@
+# auth-oauth-user.js
+
+> Octokit authentication strategy for OAuth user authentication
+
+[![@latest](https://img.shields.io/npm/v/@octokit/auth-oauth-user.svg)](https://www.npmjs.com/package/@octokit/auth-oauth-user)
+[![Build Status](https://github.com/octokit/auth-oauth-user.js/workflows/Test/badge.svg)](https://github.com/octokit/auth-oauth-user.js/actions?query=workflow%3ATest+branch%3Amain)
+
+**Important:** `@octokit/auth-oauth-user` requires your app's `client_secret`, which must not be exposed. If you are looking for an OAuth user authentication strategy that can be used on a client (browser, IoT, CLI), check out [`@octokit/auth-oauth-user-client`](https://github.com/octokit/auth-oauth-user-client.js#readme). Note that `@octokit/auth-oauth-user-client` requires a backend. The only exception is [`@octokit/auth-oauth-device`](https://github.com/octokit/auth-oauth-device.js#readme) which does not require the `client_secret`, but does not work in browsers due to CORS constraints.
+
+
+Table of contents
+
+
+
+- [Features](#features)
+- [Standalone usage](#standalone-usage)
+ - [Exchange code from OAuth web flow](#exchange-code-from-oauth-web-flow)
+ - [OAuth Device flow](#oauth-device-flow)
+ - [Use an existing authentication](#use-an-existing-authentication)
+- [Usage with Octokit](#usage-with-octokit)
+- [`createOAuthUserAuth(options)` or `new Octokit({ auth })`](#createoauthuserauthoptions-or-new-octokit-auth-)
+ - [When using GitHub's OAuth web flow](#when-using-githubs-oauth-web-flow)
+ - [When using GitHub's OAuth device flow](#when-using-githubs-oauth-device-flow)
+ - [When passing an existing authentication object](#when-passing-an-existing-authentication-object)
+- [`auth(options)` or `octokit.auth(options)`](#authoptions-or-octokitauthoptions)
+- [Authentication object](#authentication-object)
+ - [OAuth APP authentication token](#oauth-app-authentication-token)
+ - [GitHub APP user authentication token with expiring disabled](#github-app-user-authentication-token-with-expiring-disabled)
+ - [GitHub APP user authentication token with expiring enabled](#github-app-user-authentication-token-with-expiring-enabled)
+- [`auth.hook(request, route, parameters)` or `auth.hook(request, options)`](#authhookrequest-route-parameters-or-authhookrequest-options)
+- [Types](#types)
+- [Contributing](#contributing)
+- [License](#license)
+
+
+
+
+
+## Features
+
+- Code for token exchange from [GitHub's OAuth web flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow)
+- [GitHub's OAuth device flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow)
+- Caches token for succesive calls
+- Auto-refreshing for [expiring user access tokens](https://docs.github.com/en/developers/apps/refreshing-user-to-server-access-tokens)
+- Applies the correct authentication strategy based on the request URL when using with `Octokit`
+- Token verification
+- Token reset
+- Token invalidation
+- Application grant revocation
+
+## Standalone usage
+
+
+
+
+
+Browsers
+
+ |
+
+Load `@octokit/auth-oauth-user` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/auth-oauth-user`
+
+```js
+const { createOAuthUserAuth } = require("@octokit/auth-oauth-user");
+```
+
+ |
+
+
+
+### Exchange code from OAuth web flow
+
+```js
+const auth = createOAuthUserAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ code: "code123",
+ // optional
+ state: "state123",
+ redirectUrl: "https://acme-inc.com/login",
+});
+
+// Exchanges the code for the user access token authentication on first call
+// and caches the authentication for successive calls
+const { token } = await auth();
+```
+
+About [GitHub's OAuth web flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow)
+
+### OAuth Device flow
+
+```js
+const auth = createOAuthUserAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ onVerification(verification) {
+ // verification example
+ // {
+ // device_code: "3584d83530557fdd1f46af8289938c8ef79f9dc5",
+ // user_code: "WDJB-MJHT",
+ // verification_uri: "https://github.com/login/device",
+ // expires_in: 900,
+ // interval: 5,
+ // };
+
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+ },
+});
+
+// resolves once the user entered the `user_code` on `verification_uri`
+const { token } = await auth();
+```
+
+About [GitHub's OAuth device flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow)
+
+### Use an existing authentication
+
+```js
+const auth = createOAuthUserAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ clientType: "oauth-app",
+ token: "token123",
+});
+
+// will return the passed authentication
+const { token } = await auth();
+```
+
+See [Authentication object](#authentication-object).
+
+## Usage with Octokit
+
+
+
+
+
+Browsers
+
+ |
+
+`@octokit/auth-oauth-user` cannot be used in the browser. It requires `clientSecret` to be set which must not be exposed to clients, and some of the OAuth APIs it uses do not support CORS.
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/core @octokit/auth-oauth-user`. Optionally replace `@octokit/core` with a compatible module
+
+```js
+const { Octokit } = require("@octokit/core");
+const { createOAuthUserAuth } = require("@octokit/auth-oauth-user");
+```
+
+ |
+
+
+
+```js
+const octokit = new Octokit({
+ authStrategy: createOAuthUserAuth,
+ auth: {
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ code: "code123",
+ },
+});
+
+// Exchanges the code for the user access token authentication on first request
+// and caches the authentication for successive requests
+const {
+ data: { login },
+} = await octokit.request("GET /user");
+console.log("Hello, %s!", login);
+```
+
+## `createOAuthUserAuth(options)` or `new Octokit({ auth })`
+
+The `createOAuthUserAuth` method accepts a single `options` object as argument. The same set of options can be passed as `auth` to the `Octokit` constructor when setting `authStrategy: createOAuthUserAuth`
+
+### When using GitHub's OAuth web flow
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Client ID of your GitHub/OAuth App. Find it on your app's settings page.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. Client Secret for your GitHub/OAuth App. Create one on your app's settings page.
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Either "oauth-app" or "github-app" . Defaults to "oauth-app" .
+ |
+
+
+
+ code
+ |
+
+ string
+ |
+
+
+**Required.** The authorization code which was passed as query parameter to the callback URL from [GitHub's OAuth web application flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#web-application-flow).
+
+ |
+
+
+
+ state
+ |
+
+ string
+ |
+
+
+The unguessable random string you provided in [Step 1 of GitHub's OAuth web application flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#1-request-a-users-github-identity).
+
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+
+The redirect_uri parameter you provided in [Step 1 of GitHub's OAuth web application flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#1-request-a-users-github-identity).
+
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+createOAuthAppAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+### When using GitHub's OAuth device flow
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Client ID of your GitHub/OAuth App. Find it on your app's settings page.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. Client Secret for your GitHub/OAuth App. The clientSecret is not needed for the OAuth device flow itself, but it is required for resetting, refreshing, and invalidating a token. Find the Client Secret on your app's settings page.
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Either "oauth-app" or "github-app" . Defaults to "oauth-app" .
+ |
+
+
+
+ onVerification
+ |
+
+ function
+ |
+
+
+**Required**. A function that is called once the device and user codes were retrieved
+
+The `onVerification()` callback can be used to pause until the user completes step 2, which might result in a better user experience.
+
+```js
+const auth = createOAuthUserAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ onVerification(verification) {
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+
+ await prompt("press enter when you are ready to continue");
+ },
+});
+```
+
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+createOAuthAppAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ onVerification(verification) {
+ console.log("Open %s", verification.verification_uri);
+ console.log("Enter code: %s", verification.user_code);
+
+ await prompt("press enter when you are ready to continue");
+ },
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+### When passing an existing authentication object
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Either "oauth-app" or "github" .
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Client ID of your GitHub/OAuth App. Find it on your app's settings page.
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. Client Secret for your GitHub/OAuth App. Create one on your app's settings page.
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ Required. The user access token
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ Required if clientType is set to "oauth-app" . Array of OAuth scope names the token was granted
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ Only relevant if clientType is set to "github-app" and token expiration is enabled.
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Only relevant if clientType is set to "github-app" and token expiration is enabled. Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Only relevant if clientType is set to "github-app" and token expiration is enabled. Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+createOAuthAppAuth({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef1234567890abcdef12345678",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+## `auth(options)` or `octokit.auth(options)`
+
+The async `auth()` method is returned by `createOAuthUserAuth(options)` or set on the `octokit` instance when the `Octokit` constructor was called with `authStrategy: createOAuthUserAuth`.
+
+Once `auth()` receives a valid authentication object it caches it in memory and uses it for subsequent calls. It also caches if the token is invalid and no longer tries to send any requests. If the authentication is using a refresh token, a new token will be requested as needed. Calling `auth({ type: "reset" })` will replace the internally cached authentication.
+
+Resolves with an [authentication object](#authentication-object).
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+
+Without setting `type` auth will return the current authentication object, or exchange the `code` from the strategy options on first call. If the current authentication token is expired, the tokens will be refreshed.
+
+Possible values for `type` are
+
+- `"get"`: returns the token from internal state and creates it if none was created yet
+- `"check"`: sends request to verify the validity of the current token
+- `"reset"`: invalidates current token and replaces it with a new one
+- `"refresh"`: GitHub Apps only, and only if expiring user tokens are enabled.
+- `"delete"`: invalidates current token
+- `"deleteAuthorization"`: revokes OAuth access for application. All tokens for the current user created by the same app are invalidated. The user will be prompted to grant access again during the next OAuth web flow.
+
+ |
+
+
+
+
+## Authentication object
+
+There are three possible results
+
+1. [OAuth APP authentication token](#oauth-app-authentication-token)
+1. [GitHub APP user authentication token with expiring disabled](#github-app-user-authentication-token-with-expiring-disabled)
+1. [GitHub APP user authentication token with expiring enabled](#github-app-user-authentication-token-with-expiring-enabled)
+
+The differences are
+
+1. `scopes` is only present for OAuth Apps
+2. `refreshToken`, `expiresAt`, `refreshTokenExpiresAt` are only present for GitHub Apps, and only if token expiration is enabled
+
+### OAuth APP authentication token
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "oauth-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The clientId from the strategy options
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The clientSecret from the strategy options
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ array of scope names enabled for the token
+ |
+
+
+
+ invalid
+ |
+
+ boolean
+ |
+
+
+Either `undefined` or `true`. Will be set to `true` if the token was invalided explicitly or found to be invalid
+
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring disabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The clientId from the strategy options
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The clientSecret from the strategy options
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ invalid
+ |
+
+ boolean
+ |
+
+
+Either `undefined` or `true`. Will be set to `true` if the token was invalided explicitly or found to be invalid
+
+ |
+
+
+
+
+### GitHub APP user authentication token with expiring enabled
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ type
+ |
+
+ string
+ |
+
+ "token"
+ |
+
+
+
+ tokenType
+ |
+
+ string
+ |
+
+ "oauth"
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The clientId from the strategy options
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ The clientSecret from the strategy options
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ The refresh token
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+ invalid
+ |
+
+ boolean
+ |
+
+
+Either `undefined` or `true`. Will be set to `true` if the token was invalided explicitly or found to be invalid
+
+ |
+
+
+
+
+## `auth.hook(request, route, parameters)` or `auth.hook(request, options)`
+
+`auth.hook()` hooks directly into the request life cycle. It amends the request to authenticate correctly based on the request URL.
+
+The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The `route`/`options` parameters are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
+
+`auth.hook()` can be called directly to send an authenticated request
+
+```js
+const { data: user } = await auth.hook(request, "GET /user");
+```
+
+Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
+
+```js
+const requestWithAuth = request.defaults({
+ request: {
+ hook: auth.hook,
+ },
+});
+
+const { data: user } = await requestWithAuth("GET /user");
+```
+
+## Types
+
+```ts
+import {
+ GitHubAppAuthentication,
+ GitHubAppAuthenticationWithExpiration,
+ GitHubAppAuthOptions,
+ GitHubAppStrategyOptions,
+ GitHubAppStrategyOptionsDeviceFlow,
+ GitHubAppStrategyOptionsExistingAuthentication,
+ GitHubAppStrategyOptionsExistingAuthenticationWithExpiration,
+ GitHubAppStrategyOptionsWebFlow,
+ OAuthAppAuthentication,
+ OAuthAppAuthOptions,
+ OAuthAppStrategyOptions,
+ OAuthAppStrategyOptionsDeviceFlow,
+ OAuthAppStrategyOptionsExistingAuthentication,
+ OAuthAppStrategyOptionsWebFlow,
+} from "@octokit/auth-oauth-user";
+```
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md)
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/auth-oauth-user/dist-node/index.js b/node_modules/@octokit/auth-oauth-user/dist-node/index.js
new file mode 100644
index 0000000..2a095d4
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-node/index.js
@@ -0,0 +1,327 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
+
+var universalUserAgent = require('universal-user-agent');
+var request = require('@octokit/request');
+var authOauthDevice = require('@octokit/auth-oauth-device');
+var oauthMethods = require('@octokit/oauth-methods');
+var btoa = _interopDefault(require('btoa-lite'));
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+
+ if (enumerableOnly) {
+ symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ }
+
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+
+ var key, i;
+
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+const VERSION = "1.3.0";
+
+async function getAuthentication(state) {
+ // handle code exchange form OAuth Web Flow
+ if ("code" in state.strategyOptions) {
+ const {
+ authentication
+ } = await oauthMethods.exchangeWebFlowCode(_objectSpread2(_objectSpread2({
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType
+ }, state.strategyOptions), {}, {
+ request: state.request
+ }));
+ return _objectSpread2({
+ type: "token",
+ tokenType: "oauth"
+ }, authentication);
+ } // handle OAuth device flow
+
+
+ if ("onVerification" in state.strategyOptions) {
+ const deviceAuth = authOauthDevice.createOAuthDeviceAuth(_objectSpread2(_objectSpread2({
+ clientType: state.clientType,
+ clientId: state.clientId
+ }, state.strategyOptions), {}, {
+ request: state.request
+ }));
+ const authentication = await deviceAuth({
+ type: "oauth"
+ });
+ return _objectSpread2({
+ clientSecret: state.clientSecret
+ }, authentication);
+ } // use existing authentication
+
+
+ if ("token" in state.strategyOptions) {
+ return _objectSpread2({
+ type: "token",
+ tokenType: "oauth",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType
+ }, state.strategyOptions);
+ }
+
+ throw new Error("[@octokit/auth-oauth-user] Invalid strategy options");
+}
+
+async function auth(state, options = {}) {
+ if (!state.authentication) {
+ // This is what TS makes us do ¯\_(ツ)_/¯
+ state.authentication = state.clientType === "oauth-app" ? await getAuthentication(state) : await getAuthentication(state);
+ }
+
+ if (state.authentication.invalid) {
+ throw new Error("[@octokit/auth-oauth-user] Token is invalid");
+ }
+
+ const currentAuthentication = state.authentication; // (auto) refresh for user-to-server tokens
+
+ if ("expiresAt" in currentAuthentication) {
+ if (options.type === "refresh" || new Date(currentAuthentication.expiresAt) < new Date()) {
+ const {
+ authentication
+ } = await oauthMethods.refreshToken({
+ clientType: "github-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ refreshToken: currentAuthentication.refreshToken,
+ request: state.request
+ });
+ state.authentication = _objectSpread2({
+ tokenType: "oauth",
+ type: "token"
+ }, authentication);
+ }
+ } // throw error for invalid refresh call
+
+
+ if (options.type === "refresh") {
+ if (state.clientType === "oauth-app") {
+ throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
+ }
+
+ if (!currentAuthentication.hasOwnProperty("expiresAt")) {
+ throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
+ }
+ } // check or reset token
+
+
+ if (options.type === "check" || options.type === "reset") {
+ const method = options.type === "check" ? oauthMethods.checkToken : oauthMethods.resetToken;
+
+ try {
+ const {
+ authentication
+ } = await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request
+ });
+ state.authentication = _objectSpread2({
+ tokenType: "oauth",
+ type: "token"
+ }, authentication);
+ return state.authentication;
+ } catch (error) {
+ // istanbul ignore else
+ if (error.status === 404) {
+ error.message = "[@octokit/auth-oauth-user] Token is invalid"; // @ts-expect-error TBD
+
+ state.authentication.invalid = true;
+ }
+
+ throw error;
+ }
+ } // invalidate
+
+
+ if (options.type === "delete" || options.type === "deleteAuthorization") {
+ const method = options.type === "delete" ? oauthMethods.deleteToken : oauthMethods.deleteAuthorization;
+
+ try {
+ await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request
+ });
+ } catch (error) {
+ // istanbul ignore if
+ if (error.status !== 404) throw error;
+ }
+
+ state.authentication.invalid = true;
+ return state.authentication;
+ }
+
+ return state.authentication;
+}
+
+/**
+ * The following endpoints require an OAuth App to authenticate using its client_id and client_secret.
+ *
+ * - [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) - Check a token
+ * - [`PATCH /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) - Reset a token
+ * - [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) - Create a scoped access token
+ * - [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) - Delete an app token
+ * - [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) - Delete an app authorization
+ *
+ * deprecated:
+ *
+ * - [`GET /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#check-an-authorization) - Check an authorization
+ * - [`POST /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#reset-an-authorization) - Reset an authorization
+ * - [`DELETE /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-an-authorization-for-an-application) - Revoke an authorization for an application
+ * - [`DELETE /applications/{client_id}/grants/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-a-grant-for-an-application) - Revoke a grant for an application
+ */
+const ROUTES_REQUIRING_BASIC_AUTH = /\/applications\/[^/]+\/(token|grant)s?/;
+function requiresBasicAuth(url) {
+ return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);
+}
+
+async function hook(state, request, route, parameters = {}) {
+ const endpoint = request.endpoint.merge(route, parameters); // Do not intercept OAuth Web/Device flow request
+
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+
+ if (requiresBasicAuth(endpoint.url)) {
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+ return request(endpoint);
+ } // TS makes us do this ¯\_(ツ)_/¯
+
+
+ const {
+ token
+ } = state.clientType === "oauth-app" ? await auth(_objectSpread2(_objectSpread2({}, state), {}, {
+ request
+ })) : await auth(_objectSpread2(_objectSpread2({}, state), {}, {
+ request
+ }));
+ endpoint.headers.authorization = "token " + token;
+ return request(endpoint);
+}
+
+const _excluded = ["clientId", "clientSecret", "clientType", "request"];
+function createOAuthUserAuth(_ref) {
+ let {
+ clientId,
+ clientSecret,
+ clientType = "oauth-app",
+ request: request$1 = request.request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
+ }
+ })
+ } = _ref,
+ strategyOptions = _objectWithoutProperties(_ref, _excluded);
+
+ const state = Object.assign({
+ clientType,
+ clientId,
+ clientSecret,
+ strategyOptions,
+ request: request$1
+ }); // @ts-expect-error not worth the extra code needed to appease TS
+
+ return Object.assign(auth.bind(null, state), {
+ // @ts-expect-error not worth the extra code needed to appease TS
+ hook: hook.bind(null, state)
+ });
+}
+createOAuthUserAuth.VERSION = VERSION;
+
+exports.createOAuthUserAuth = createOAuthUserAuth;
+exports.requiresBasicAuth = requiresBasicAuth;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-user/dist-node/index.js.map b/node_modules/@octokit/auth-oauth-user/dist-node/index.js.map
new file mode 100644
index 0000000..c359a01
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-authentication.js","../dist-src/auth.js","../dist-src/requires-basic-auth.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"1.3.0\";\n","// @ts-nocheck there is only place for one of us in this file. And it's not you, TS\nimport { createOAuthDeviceAuth } from \"@octokit/auth-oauth-device\";\nimport { exchangeWebFlowCode } from \"@octokit/oauth-methods\";\nexport async function getAuthentication(state) {\n // handle code exchange form OAuth Web Flow\n if (\"code\" in state.strategyOptions) {\n const { authentication } = await exchangeWebFlowCode({\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n ...state.strategyOptions,\n request: state.request,\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n // handle OAuth device flow\n if (\"onVerification\" in state.strategyOptions) {\n const deviceAuth = createOAuthDeviceAuth({\n clientType: state.clientType,\n clientId: state.clientId,\n ...state.strategyOptions,\n request: state.request,\n });\n const authentication = await deviceAuth({\n type: \"oauth\",\n });\n return {\n clientSecret: state.clientSecret,\n ...authentication,\n };\n }\n // use existing authentication\n if (\"token\" in state.strategyOptions) {\n return {\n type: \"token\",\n tokenType: \"oauth\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n ...state.strategyOptions,\n };\n }\n throw new Error(\"[@octokit/auth-oauth-user] Invalid strategy options\");\n}\n","import { getAuthentication } from \"./get-authentication\";\nimport { checkToken, deleteAuthorization, deleteToken, refreshToken, resetToken, } from \"@octokit/oauth-methods\";\nexport async function auth(state, options = {}) {\n if (!state.authentication) {\n // This is what TS makes us do ¯\\_(ツ)_/¯\n state.authentication =\n state.clientType === \"oauth-app\"\n ? await getAuthentication(state)\n : await getAuthentication(state);\n }\n if (state.authentication.invalid) {\n throw new Error(\"[@octokit/auth-oauth-user] Token is invalid\");\n }\n const currentAuthentication = state.authentication;\n // (auto) refresh for user-to-server tokens\n if (\"expiresAt\" in currentAuthentication) {\n if (options.type === \"refresh\" ||\n new Date(currentAuthentication.expiresAt) < new Date()) {\n const { authentication } = await refreshToken({\n clientType: \"github-app\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n refreshToken: currentAuthentication.refreshToken,\n request: state.request,\n });\n state.authentication = {\n tokenType: \"oauth\",\n type: \"token\",\n ...authentication,\n };\n }\n }\n // throw error for invalid refresh call\n if (options.type === \"refresh\") {\n if (state.clientType === \"oauth-app\") {\n throw new Error(\"[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens\");\n }\n if (!currentAuthentication.hasOwnProperty(\"expiresAt\")) {\n throw new Error(\"[@octokit/auth-oauth-user] Refresh token missing\");\n }\n }\n // check or reset token\n if (options.type === \"check\" || options.type === \"reset\") {\n const method = options.type === \"check\" ? checkToken : resetToken;\n try {\n const { authentication } = await method({\n // @ts-expect-error making TS happy would require unnecessary code so no\n clientType: state.clientType,\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n token: state.authentication.token,\n request: state.request,\n });\n state.authentication = {\n tokenType: \"oauth\",\n type: \"token\",\n // @ts-expect-error TBD\n ...authentication,\n };\n return state.authentication;\n }\n catch (error) {\n // istanbul ignore else\n if (error.status === 404) {\n error.message = \"[@octokit/auth-oauth-user] Token is invalid\";\n // @ts-expect-error TBD\n state.authentication.invalid = true;\n }\n throw error;\n }\n }\n // invalidate\n if (options.type === \"delete\" || options.type === \"deleteAuthorization\") {\n const method = options.type === \"delete\" ? deleteToken : deleteAuthorization;\n try {\n await method({\n // @ts-expect-error making TS happy would require unnecessary code so no\n clientType: state.clientType,\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n token: state.authentication.token,\n request: state.request,\n });\n }\n catch (error) {\n // istanbul ignore if\n if (error.status !== 404)\n throw error;\n }\n state.authentication.invalid = true;\n return state.authentication;\n }\n return state.authentication;\n}\n","/**\n * The following endpoints require an OAuth App to authenticate using its client_id and client_secret.\n *\n * - [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) - Check a token\n * - [`PATCH /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) - Reset a token\n * - [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) - Create a scoped access token\n * - [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) - Delete an app token\n * - [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) - Delete an app authorization\n *\n * deprecated:\n *\n * - [`GET /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#check-an-authorization) - Check an authorization\n * - [`POST /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#reset-an-authorization) - Reset an authorization\n * - [`DELETE /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-an-authorization-for-an-application) - Revoke an authorization for an application\n * - [`DELETE /applications/{client_id}/grants/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-a-grant-for-an-application) - Revoke a grant for an application\n */\nconst ROUTES_REQUIRING_BASIC_AUTH = /\\/applications\\/[^/]+\\/(token|grant)s?/;\nexport function requiresBasicAuth(url) {\n return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);\n}\n","import btoa from \"btoa-lite\";\nimport { auth } from \"./auth\";\nimport { requiresBasicAuth } from \"./requires-basic-auth\";\nexport async function hook(state, request, route, parameters = {}) {\n const endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept OAuth Web/Device flow request\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n if (requiresBasicAuth(endpoint.url)) {\n const credentials = btoa(`${state.clientId}:${state.clientSecret}`);\n endpoint.headers.authorization = `basic ${credentials}`;\n return request(endpoint);\n }\n // TS makes us do this ¯\\_(ツ)_/¯\n const { token } = state.clientType === \"oauth-app\"\n ? await auth({ ...state, request })\n : await auth({ ...state, request });\n endpoint.headers.authorization = \"token \" + token;\n return request(endpoint);\n}\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { VERSION } from \"./version\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport { requiresBasicAuth } from \"./requires-basic-auth\";\nexport function createOAuthUserAuth({ clientId, clientSecret, clientType = \"oauth-app\", request = octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,\n },\n}), ...strategyOptions }) {\n const state = Object.assign({\n clientType,\n clientId,\n clientSecret,\n strategyOptions,\n request,\n });\n // @ts-expect-error not worth the extra code needed to appease TS\n return Object.assign(auth.bind(null, state), {\n // @ts-expect-error not worth the extra code needed to appease TS\n hook: hook.bind(null, state),\n });\n}\ncreateOAuthUserAuth.VERSION = VERSION;\n"],"names":["VERSION","getAuthentication","state","strategyOptions","authentication","exchangeWebFlowCode","clientId","clientSecret","clientType","request","type","tokenType","deviceAuth","createOAuthDeviceAuth","Error","auth","options","invalid","currentAuthentication","Date","expiresAt","refreshToken","hasOwnProperty","method","checkToken","resetToken","token","error","status","message","deleteToken","deleteAuthorization","ROUTES_REQUIRING_BASIC_AUTH","requiresBasicAuth","url","test","hook","route","parameters","endpoint","merge","credentials","btoa","headers","authorization","createOAuthUserAuth","octokitRequest","defaults","getUserAgent","Object","assign","bind"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAAL,CAAU,IAAV,EAAgBjD,KAAhB;AAFmC,GAAtC,CAAP;AAIH;AACD2C,mBAAmB,CAAC7C,OAApB,GAA8BA,OAA9B;;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/auth.js b/node_modules/@octokit/auth-oauth-user/dist-src/auth.js
new file mode 100644
index 0000000..07e42da
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/auth.js
@@ -0,0 +1,94 @@
+import { getAuthentication } from "./get-authentication";
+import { checkToken, deleteAuthorization, deleteToken, refreshToken, resetToken, } from "@octokit/oauth-methods";
+export async function auth(state, options = {}) {
+ if (!state.authentication) {
+ // This is what TS makes us do ¯\_(ツ)_/¯
+ state.authentication =
+ state.clientType === "oauth-app"
+ ? await getAuthentication(state)
+ : await getAuthentication(state);
+ }
+ if (state.authentication.invalid) {
+ throw new Error("[@octokit/auth-oauth-user] Token is invalid");
+ }
+ const currentAuthentication = state.authentication;
+ // (auto) refresh for user-to-server tokens
+ if ("expiresAt" in currentAuthentication) {
+ if (options.type === "refresh" ||
+ new Date(currentAuthentication.expiresAt) < new Date()) {
+ const { authentication } = await refreshToken({
+ clientType: "github-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ refreshToken: currentAuthentication.refreshToken,
+ request: state.request,
+ });
+ state.authentication = {
+ tokenType: "oauth",
+ type: "token",
+ ...authentication,
+ };
+ }
+ }
+ // throw error for invalid refresh call
+ if (options.type === "refresh") {
+ if (state.clientType === "oauth-app") {
+ throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
+ }
+ if (!currentAuthentication.hasOwnProperty("expiresAt")) {
+ throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
+ }
+ }
+ // check or reset token
+ if (options.type === "check" || options.type === "reset") {
+ const method = options.type === "check" ? checkToken : resetToken;
+ try {
+ const { authentication } = await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request,
+ });
+ state.authentication = {
+ tokenType: "oauth",
+ type: "token",
+ // @ts-expect-error TBD
+ ...authentication,
+ };
+ return state.authentication;
+ }
+ catch (error) {
+ // istanbul ignore else
+ if (error.status === 404) {
+ error.message = "[@octokit/auth-oauth-user] Token is invalid";
+ // @ts-expect-error TBD
+ state.authentication.invalid = true;
+ }
+ throw error;
+ }
+ }
+ // invalidate
+ if (options.type === "delete" || options.type === "deleteAuthorization") {
+ const method = options.type === "delete" ? deleteToken : deleteAuthorization;
+ try {
+ await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request,
+ });
+ }
+ catch (error) {
+ // istanbul ignore if
+ if (error.status !== 404)
+ throw error;
+ }
+ state.authentication.invalid = true;
+ return state.authentication;
+ }
+ return state.authentication;
+}
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/get-authentication.js b/node_modules/@octokit/auth-oauth-user/dist-src/get-authentication.js
new file mode 100644
index 0000000..6b08d77
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/get-authentication.js
@@ -0,0 +1,48 @@
+// @ts-nocheck there is only place for one of us in this file. And it's not you, TS
+import { createOAuthDeviceAuth } from "@octokit/auth-oauth-device";
+import { exchangeWebFlowCode } from "@octokit/oauth-methods";
+export async function getAuthentication(state) {
+ // handle code exchange form OAuth Web Flow
+ if ("code" in state.strategyOptions) {
+ const { authentication } = await exchangeWebFlowCode({
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ ...state.strategyOptions,
+ request: state.request,
+ });
+ return {
+ type: "token",
+ tokenType: "oauth",
+ ...authentication,
+ };
+ }
+ // handle OAuth device flow
+ if ("onVerification" in state.strategyOptions) {
+ const deviceAuth = createOAuthDeviceAuth({
+ clientType: state.clientType,
+ clientId: state.clientId,
+ ...state.strategyOptions,
+ request: state.request,
+ });
+ const authentication = await deviceAuth({
+ type: "oauth",
+ });
+ return {
+ clientSecret: state.clientSecret,
+ ...authentication,
+ };
+ }
+ // use existing authentication
+ if ("token" in state.strategyOptions) {
+ return {
+ type: "token",
+ tokenType: "oauth",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ ...state.strategyOptions,
+ };
+ }
+ throw new Error("[@octokit/auth-oauth-user] Invalid strategy options");
+}
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/hook.js b/node_modules/@octokit/auth-oauth-user/dist-src/hook.js
new file mode 100644
index 0000000..8977ac4
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/hook.js
@@ -0,0 +1,21 @@
+import btoa from "btoa-lite";
+import { auth } from "./auth";
+import { requiresBasicAuth } from "./requires-basic-auth";
+export async function hook(state, request, route, parameters = {}) {
+ const endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept OAuth Web/Device flow request
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ if (requiresBasicAuth(endpoint.url)) {
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+ return request(endpoint);
+ }
+ // TS makes us do this ¯\_(ツ)_/¯
+ const { token } = state.clientType === "oauth-app"
+ ? await auth({ ...state, request })
+ : await auth({ ...state, request });
+ endpoint.headers.authorization = "token " + token;
+ return request(endpoint);
+}
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/index.js b/node_modules/@octokit/auth-oauth-user/dist-src/index.js
new file mode 100644
index 0000000..4c205f1
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/index.js
@@ -0,0 +1,25 @@
+import { getUserAgent } from "universal-user-agent";
+import { request as octokitRequest } from "@octokit/request";
+import { VERSION } from "./version";
+import { auth } from "./auth";
+import { hook } from "./hook";
+export { requiresBasicAuth } from "./requires-basic-auth";
+export function createOAuthUserAuth({ clientId, clientSecret, clientType = "oauth-app", request = octokitRequest.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+}), ...strategyOptions }) {
+ const state = Object.assign({
+ clientType,
+ clientId,
+ clientSecret,
+ strategyOptions,
+ request,
+ });
+ // @ts-expect-error not worth the extra code needed to appease TS
+ return Object.assign(auth.bind(null, state), {
+ // @ts-expect-error not worth the extra code needed to appease TS
+ hook: hook.bind(null, state),
+ });
+}
+createOAuthUserAuth.VERSION = VERSION;
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/requires-basic-auth.js b/node_modules/@octokit/auth-oauth-user/dist-src/requires-basic-auth.js
new file mode 100644
index 0000000..d10f02c
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/requires-basic-auth.js
@@ -0,0 +1,20 @@
+/**
+ * The following endpoints require an OAuth App to authenticate using its client_id and client_secret.
+ *
+ * - [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) - Check a token
+ * - [`PATCH /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) - Reset a token
+ * - [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) - Create a scoped access token
+ * - [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) - Delete an app token
+ * - [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) - Delete an app authorization
+ *
+ * deprecated:
+ *
+ * - [`GET /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#check-an-authorization) - Check an authorization
+ * - [`POST /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#reset-an-authorization) - Reset an authorization
+ * - [`DELETE /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-an-authorization-for-an-application) - Revoke an authorization for an application
+ * - [`DELETE /applications/{client_id}/grants/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-a-grant-for-an-application) - Revoke a grant for an application
+ */
+const ROUTES_REQUIRING_BASIC_AUTH = /\/applications\/[^/]+\/(token|grant)s?/;
+export function requiresBasicAuth(url) {
+ return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);
+}
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/types.js b/node_modules/@octokit/auth-oauth-user/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/auth-oauth-user/dist-src/version.js b/node_modules/@octokit/auth-oauth-user/dist-src/version.js
new file mode 100644
index 0000000..e853866
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "1.3.0";
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/auth.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/auth.d.ts
new file mode 100644
index 0000000..d85f08b
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/auth.d.ts
@@ -0,0 +1,3 @@
+import { OAuthAppAuthOptions, GitHubAppAuthOptions, OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, OAuthAppState, GitHubAppState } from "./types";
+export declare function auth(state: OAuthAppState, options?: OAuthAppAuthOptions): Promise;
+export declare function auth(state: GitHubAppState, options?: GitHubAppAuthOptions): Promise;
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/get-authentication.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/get-authentication.d.ts
new file mode 100644
index 0000000..359accb
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/get-authentication.d.ts
@@ -0,0 +1,3 @@
+import { OAuthAppState, GitHubAppState, OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration } from "./types";
+export declare function getAuthentication(state: OAuthAppState): Promise;
+export declare function getAuthentication(state: GitHubAppState): Promise;
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/hook.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/hook.d.ts
new file mode 100644
index 0000000..c3395d6
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/hook.d.ts
@@ -0,0 +1,6 @@
+import { EndpointOptions, OctokitResponse, RequestInterface, RequestParameters, Route } from "@octokit/types";
+import { OAuthAppState, GitHubAppState } from "./types";
+declare type AnyResponse = OctokitResponse;
+export declare function hook(state: OAuthAppState, request: RequestInterface, route: Route | EndpointOptions, parameters: RequestParameters): Promise;
+export declare function hook(state: GitHubAppState, request: RequestInterface, route: Route | EndpointOptions, parameters: RequestParameters): Promise;
+export {};
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/index.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/index.d.ts
new file mode 100644
index 0000000..ae56794
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/index.d.ts
@@ -0,0 +1,11 @@
+import { OAuthAppStrategyOptions, GitHubAppStrategyOptions, OAuthAppAuthInterface, GitHubAppAuthInterface } from "./types";
+export { OAuthAppStrategyOptionsWebFlow, GitHubAppStrategyOptionsWebFlow, OAuthAppStrategyOptionsDeviceFlow, GitHubAppStrategyOptionsDeviceFlow, OAuthAppStrategyOptionsExistingAuthentication, GitHubAppStrategyOptionsExistingAuthentication, GitHubAppStrategyOptionsExistingAuthenticationWithExpiration, OAuthAppStrategyOptions, GitHubAppStrategyOptions, OAuthAppAuthOptions, GitHubAppAuthOptions, OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, } from "./types";
+export { requiresBasicAuth } from "./requires-basic-auth";
+export declare function createOAuthUserAuth(options: OAuthAppStrategyOptions): OAuthAppAuthInterface;
+export declare namespace createOAuthUserAuth {
+ var VERSION: string;
+}
+export declare function createOAuthUserAuth(options: GitHubAppStrategyOptions): GitHubAppAuthInterface;
+export declare namespace createOAuthUserAuth {
+ var VERSION: string;
+}
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/requires-basic-auth.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/requires-basic-auth.d.ts
new file mode 100644
index 0000000..c7a90ea
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/requires-basic-auth.d.ts
@@ -0,0 +1 @@
+export declare function requiresBasicAuth(url: string | undefined): boolean | "" | undefined;
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/types.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/types.d.ts
new file mode 100644
index 0000000..d619abd
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/types.d.ts
@@ -0,0 +1,110 @@
+import * as OctokitTypes from "@octokit/types";
+import * as DeviceTypes from "@octokit/auth-oauth-device";
+import * as OAuthMethodsTypes from "@octokit/oauth-methods";
+export declare type ClientType = "oauth-app" | "github-app";
+export declare type WebFlowOptions = {
+ code: string;
+ state?: string;
+ redirectUrl?: string;
+};
+declare type CommonOAuthAppStrategyOptions = {
+ clientType?: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ request?: OctokitTypes.RequestInterface;
+};
+declare type CommonGitHubAppStrategyOptions = {
+ clientType?: "github-app";
+ clientId: string;
+ clientSecret: string;
+ request?: OctokitTypes.RequestInterface;
+};
+declare type OAuthAppDeviceFlowOptions = {
+ onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
+ scopes?: string[];
+};
+declare type GitHubDeviceFlowOptions = {
+ onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
+};
+declare type ExistingOAuthAppAuthenticationOptions = {
+ clientType: "oauth-app";
+ token: string;
+ scopes: string[];
+};
+declare type ExistingGitHubAppAuthenticationOptions = {
+ token: string;
+};
+declare type ExistingGitHubAppAuthenticationWithExpirationOptions = {
+ token: string;
+ refreshToken: string;
+ expiresAt: string;
+ refreshTokenExpiresAt: string;
+};
+export declare type OAuthAppStrategyOptionsWebFlow = CommonOAuthAppStrategyOptions & WebFlowOptions;
+export declare type GitHubAppStrategyOptionsWebFlow = CommonGitHubAppStrategyOptions & WebFlowOptions;
+export declare type OAuthAppStrategyOptionsDeviceFlow = CommonOAuthAppStrategyOptions & OAuthAppDeviceFlowOptions;
+export declare type GitHubAppStrategyOptionsDeviceFlow = CommonGitHubAppStrategyOptions & GitHubDeviceFlowOptions;
+export declare type OAuthAppStrategyOptionsExistingAuthentication = CommonOAuthAppStrategyOptions & ExistingOAuthAppAuthenticationOptions;
+export declare type GitHubAppStrategyOptionsExistingAuthentication = CommonGitHubAppStrategyOptions & ExistingGitHubAppAuthenticationOptions;
+export declare type GitHubAppStrategyOptionsExistingAuthenticationWithExpiration = CommonGitHubAppStrategyOptions & ExistingGitHubAppAuthenticationWithExpirationOptions;
+export declare type OAuthAppStrategyOptions = OAuthAppStrategyOptionsWebFlow | OAuthAppStrategyOptionsDeviceFlow | OAuthAppStrategyOptionsExistingAuthentication;
+export declare type GitHubAppStrategyOptions = GitHubAppStrategyOptionsWebFlow | GitHubAppStrategyOptionsDeviceFlow | GitHubAppStrategyOptionsExistingAuthentication | GitHubAppStrategyOptionsExistingAuthenticationWithExpiration;
+export declare type OAuthAppAuthentication = {
+ tokenType: "oauth";
+ type: "token";
+} & OAuthMethodsTypes.OAuthAppAuthentication;
+export declare type GitHubAppAuthentication = {
+ tokenType: "oauth";
+ type: "token";
+} & OAuthMethodsTypes.GitHubAppAuthentication;
+export declare type GitHubAppAuthenticationWithExpiration = {
+ tokenType: "oauth";
+ type: "token";
+} & OAuthMethodsTypes.GitHubAppAuthenticationWithExpiration;
+export interface OAuthAppAuthInterface {
+ (options?: OAuthAppAuthOptions): Promise;
+ hook(request: OctokitTypes.RequestInterface, route: OctokitTypes.Route | OctokitTypes.EndpointOptions, parameters?: OctokitTypes.RequestParameters): Promise>;
+}
+export interface GitHubAppAuthInterface {
+ (options?: GitHubAppAuthOptions): Promise;
+ hook(request: OctokitTypes.RequestInterface, route: OctokitTypes.Route | OctokitTypes.EndpointOptions, parameters?: OctokitTypes.RequestParameters): Promise>;
+}
+export declare type OAuthAppState = {
+ clientId: string;
+ clientSecret: string;
+ clientType: "oauth-app";
+ request: OctokitTypes.RequestInterface;
+ strategyOptions: WebFlowOptions | OAuthAppDeviceFlowOptions | ExistingOAuthAppAuthenticationOptions;
+ authentication?: OAuthAppAuthentication & {
+ invalid?: true;
+ };
+};
+declare type GitHubAppStateAuthentication = GitHubAppAuthentication & {
+ invalid?: true;
+};
+declare type GitHubAppStateAuthenticationWIthExpiration = GitHubAppAuthenticationWithExpiration & {
+ invalid?: true;
+};
+export declare type GitHubAppState = {
+ clientId: string;
+ clientSecret: string;
+ clientType: "github-app";
+ request: OctokitTypes.RequestInterface;
+ strategyOptions: WebFlowOptions | GitHubDeviceFlowOptions | ExistingGitHubAppAuthenticationOptions | ExistingGitHubAppAuthenticationWithExpirationOptions;
+ authentication?: GitHubAppStateAuthentication | GitHubAppStateAuthenticationWIthExpiration;
+};
+export declare type State = OAuthAppState | GitHubAppState;
+export declare type WebFlowState = {
+ clientId: string;
+ clientSecret: string;
+ clientType: ClientType;
+ request: OctokitTypes.RequestInterface;
+ strategyOptions: WebFlowOptions;
+};
+export declare type OAuthAppAuthOptions = {
+ type?: "get" | "check" | "reset" | "delete" | "deleteAuthorization";
+};
+export declare type GitHubAppAuthOptions = {
+ type?: "get" | "check" | "reset" | "refresh" | "delete" | "deleteAuthorization";
+};
+export {};
diff --git a/node_modules/@octokit/auth-oauth-user/dist-types/version.d.ts b/node_modules/@octokit/auth-oauth-user/dist-types/version.d.ts
new file mode 100644
index 0000000..52b0e6b
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "1.3.0";
diff --git a/node_modules/@octokit/auth-oauth-user/dist-web/index.js b/node_modules/@octokit/auth-oauth-user/dist-web/index.js
new file mode 100644
index 0000000..b67f44a
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-web/index.js
@@ -0,0 +1,210 @@
+import { getUserAgent } from 'universal-user-agent';
+import { request } from '@octokit/request';
+import { createOAuthDeviceAuth } from '@octokit/auth-oauth-device';
+import { exchangeWebFlowCode, refreshToken, checkToken, resetToken, deleteToken, deleteAuthorization } from '@octokit/oauth-methods';
+import btoa from 'btoa-lite';
+
+const VERSION = "1.3.0";
+
+// @ts-nocheck there is only place for one of us in this file. And it's not you, TS
+async function getAuthentication(state) {
+ // handle code exchange form OAuth Web Flow
+ if ("code" in state.strategyOptions) {
+ const { authentication } = await exchangeWebFlowCode({
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ ...state.strategyOptions,
+ request: state.request,
+ });
+ return {
+ type: "token",
+ tokenType: "oauth",
+ ...authentication,
+ };
+ }
+ // handle OAuth device flow
+ if ("onVerification" in state.strategyOptions) {
+ const deviceAuth = createOAuthDeviceAuth({
+ clientType: state.clientType,
+ clientId: state.clientId,
+ ...state.strategyOptions,
+ request: state.request,
+ });
+ const authentication = await deviceAuth({
+ type: "oauth",
+ });
+ return {
+ clientSecret: state.clientSecret,
+ ...authentication,
+ };
+ }
+ // use existing authentication
+ if ("token" in state.strategyOptions) {
+ return {
+ type: "token",
+ tokenType: "oauth",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ clientType: state.clientType,
+ ...state.strategyOptions,
+ };
+ }
+ throw new Error("[@octokit/auth-oauth-user] Invalid strategy options");
+}
+
+async function auth(state, options = {}) {
+ if (!state.authentication) {
+ // This is what TS makes us do ¯\_(ツ)_/¯
+ state.authentication =
+ state.clientType === "oauth-app"
+ ? await getAuthentication(state)
+ : await getAuthentication(state);
+ }
+ if (state.authentication.invalid) {
+ throw new Error("[@octokit/auth-oauth-user] Token is invalid");
+ }
+ const currentAuthentication = state.authentication;
+ // (auto) refresh for user-to-server tokens
+ if ("expiresAt" in currentAuthentication) {
+ if (options.type === "refresh" ||
+ new Date(currentAuthentication.expiresAt) < new Date()) {
+ const { authentication } = await refreshToken({
+ clientType: "github-app",
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ refreshToken: currentAuthentication.refreshToken,
+ request: state.request,
+ });
+ state.authentication = {
+ tokenType: "oauth",
+ type: "token",
+ ...authentication,
+ };
+ }
+ }
+ // throw error for invalid refresh call
+ if (options.type === "refresh") {
+ if (state.clientType === "oauth-app") {
+ throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
+ }
+ if (!currentAuthentication.hasOwnProperty("expiresAt")) {
+ throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
+ }
+ }
+ // check or reset token
+ if (options.type === "check" || options.type === "reset") {
+ const method = options.type === "check" ? checkToken : resetToken;
+ try {
+ const { authentication } = await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request,
+ });
+ state.authentication = {
+ tokenType: "oauth",
+ type: "token",
+ // @ts-expect-error TBD
+ ...authentication,
+ };
+ return state.authentication;
+ }
+ catch (error) {
+ // istanbul ignore else
+ if (error.status === 404) {
+ error.message = "[@octokit/auth-oauth-user] Token is invalid";
+ // @ts-expect-error TBD
+ state.authentication.invalid = true;
+ }
+ throw error;
+ }
+ }
+ // invalidate
+ if (options.type === "delete" || options.type === "deleteAuthorization") {
+ const method = options.type === "delete" ? deleteToken : deleteAuthorization;
+ try {
+ await method({
+ // @ts-expect-error making TS happy would require unnecessary code so no
+ clientType: state.clientType,
+ clientId: state.clientId,
+ clientSecret: state.clientSecret,
+ token: state.authentication.token,
+ request: state.request,
+ });
+ }
+ catch (error) {
+ // istanbul ignore if
+ if (error.status !== 404)
+ throw error;
+ }
+ state.authentication.invalid = true;
+ return state.authentication;
+ }
+ return state.authentication;
+}
+
+/**
+ * The following endpoints require an OAuth App to authenticate using its client_id and client_secret.
+ *
+ * - [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) - Check a token
+ * - [`PATCH /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) - Reset a token
+ * - [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) - Create a scoped access token
+ * - [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) - Delete an app token
+ * - [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) - Delete an app authorization
+ *
+ * deprecated:
+ *
+ * - [`GET /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#check-an-authorization) - Check an authorization
+ * - [`POST /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#reset-an-authorization) - Reset an authorization
+ * - [`DELETE /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-an-authorization-for-an-application) - Revoke an authorization for an application
+ * - [`DELETE /applications/{client_id}/grants/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-a-grant-for-an-application) - Revoke a grant for an application
+ */
+const ROUTES_REQUIRING_BASIC_AUTH = /\/applications\/[^/]+\/(token|grant)s?/;
+function requiresBasicAuth(url) {
+ return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);
+}
+
+async function hook(state, request, route, parameters = {}) {
+ const endpoint = request.endpoint.merge(route, parameters);
+ // Do not intercept OAuth Web/Device flow request
+ if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
+ return request(endpoint);
+ }
+ if (requiresBasicAuth(endpoint.url)) {
+ const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
+ endpoint.headers.authorization = `basic ${credentials}`;
+ return request(endpoint);
+ }
+ // TS makes us do this ¯\_(ツ)_/¯
+ const { token } = state.clientType === "oauth-app"
+ ? await auth({ ...state, request })
+ : await auth({ ...state, request });
+ endpoint.headers.authorization = "token " + token;
+ return request(endpoint);
+}
+
+function createOAuthUserAuth({ clientId, clientSecret, clientType = "oauth-app", request: request$1 = request.defaults({
+ headers: {
+ "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,
+ },
+}), ...strategyOptions }) {
+ const state = Object.assign({
+ clientType,
+ clientId,
+ clientSecret,
+ strategyOptions,
+ request: request$1,
+ });
+ // @ts-expect-error not worth the extra code needed to appease TS
+ return Object.assign(auth.bind(null, state), {
+ // @ts-expect-error not worth the extra code needed to appease TS
+ hook: hook.bind(null, state),
+ });
+}
+createOAuthUserAuth.VERSION = VERSION;
+
+export { createOAuthUserAuth, requiresBasicAuth };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/auth-oauth-user/dist-web/index.js.map b/node_modules/@octokit/auth-oauth-user/dist-web/index.js.map
new file mode 100644
index 0000000..86d31ff
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-authentication.js","../dist-src/auth.js","../dist-src/requires-basic-auth.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"1.3.0\";\n","// @ts-nocheck there is only place for one of us in this file. And it's not you, TS\nimport { createOAuthDeviceAuth } from \"@octokit/auth-oauth-device\";\nimport { exchangeWebFlowCode } from \"@octokit/oauth-methods\";\nexport async function getAuthentication(state) {\n // handle code exchange form OAuth Web Flow\n if (\"code\" in state.strategyOptions) {\n const { authentication } = await exchangeWebFlowCode({\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n ...state.strategyOptions,\n request: state.request,\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n // handle OAuth device flow\n if (\"onVerification\" in state.strategyOptions) {\n const deviceAuth = createOAuthDeviceAuth({\n clientType: state.clientType,\n clientId: state.clientId,\n ...state.strategyOptions,\n request: state.request,\n });\n const authentication = await deviceAuth({\n type: \"oauth\",\n });\n return {\n clientSecret: state.clientSecret,\n ...authentication,\n };\n }\n // use existing authentication\n if (\"token\" in state.strategyOptions) {\n return {\n type: \"token\",\n tokenType: \"oauth\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n ...state.strategyOptions,\n };\n }\n throw new Error(\"[@octokit/auth-oauth-user] Invalid strategy options\");\n}\n","import { getAuthentication } from \"./get-authentication\";\nimport { checkToken, deleteAuthorization, deleteToken, refreshToken, resetToken, } from \"@octokit/oauth-methods\";\nexport async function auth(state, options = {}) {\n if (!state.authentication) {\n // This is what TS makes us do ¯\\_(ツ)_/¯\n state.authentication =\n state.clientType === \"oauth-app\"\n ? await getAuthentication(state)\n : await getAuthentication(state);\n }\n if (state.authentication.invalid) {\n throw new Error(\"[@octokit/auth-oauth-user] Token is invalid\");\n }\n const currentAuthentication = state.authentication;\n // (auto) refresh for user-to-server tokens\n if (\"expiresAt\" in currentAuthentication) {\n if (options.type === \"refresh\" ||\n new Date(currentAuthentication.expiresAt) < new Date()) {\n const { authentication } = await refreshToken({\n clientType: \"github-app\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n refreshToken: currentAuthentication.refreshToken,\n request: state.request,\n });\n state.authentication = {\n tokenType: \"oauth\",\n type: \"token\",\n ...authentication,\n };\n }\n }\n // throw error for invalid refresh call\n if (options.type === \"refresh\") {\n if (state.clientType === \"oauth-app\") {\n throw new Error(\"[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens\");\n }\n if (!currentAuthentication.hasOwnProperty(\"expiresAt\")) {\n throw new Error(\"[@octokit/auth-oauth-user] Refresh token missing\");\n }\n }\n // check or reset token\n if (options.type === \"check\" || options.type === \"reset\") {\n const method = options.type === \"check\" ? checkToken : resetToken;\n try {\n const { authentication } = await method({\n // @ts-expect-error making TS happy would require unnecessary code so no\n clientType: state.clientType,\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n token: state.authentication.token,\n request: state.request,\n });\n state.authentication = {\n tokenType: \"oauth\",\n type: \"token\",\n // @ts-expect-error TBD\n ...authentication,\n };\n return state.authentication;\n }\n catch (error) {\n // istanbul ignore else\n if (error.status === 404) {\n error.message = \"[@octokit/auth-oauth-user] Token is invalid\";\n // @ts-expect-error TBD\n state.authentication.invalid = true;\n }\n throw error;\n }\n }\n // invalidate\n if (options.type === \"delete\" || options.type === \"deleteAuthorization\") {\n const method = options.type === \"delete\" ? deleteToken : deleteAuthorization;\n try {\n await method({\n // @ts-expect-error making TS happy would require unnecessary code so no\n clientType: state.clientType,\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n token: state.authentication.token,\n request: state.request,\n });\n }\n catch (error) {\n // istanbul ignore if\n if (error.status !== 404)\n throw error;\n }\n state.authentication.invalid = true;\n return state.authentication;\n }\n return state.authentication;\n}\n","/**\n * The following endpoints require an OAuth App to authenticate using its client_id and client_secret.\n *\n * - [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) - Check a token\n * - [`PATCH /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) - Reset a token\n * - [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) - Create a scoped access token\n * - [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) - Delete an app token\n * - [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) - Delete an app authorization\n *\n * deprecated:\n *\n * - [`GET /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#check-an-authorization) - Check an authorization\n * - [`POST /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#reset-an-authorization) - Reset an authorization\n * - [`DELETE /applications/{client_id}/tokens/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-an-authorization-for-an-application) - Revoke an authorization for an application\n * - [`DELETE /applications/{client_id}/grants/{access_token}`](https://docs.github.com/en/rest/reference/apps#revoke-a-grant-for-an-application) - Revoke a grant for an application\n */\nconst ROUTES_REQUIRING_BASIC_AUTH = /\\/applications\\/[^/]+\\/(token|grant)s?/;\nexport function requiresBasicAuth(url) {\n return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);\n}\n","import btoa from \"btoa-lite\";\nimport { auth } from \"./auth\";\nimport { requiresBasicAuth } from \"./requires-basic-auth\";\nexport async function hook(state, request, route, parameters = {}) {\n const endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept OAuth Web/Device flow request\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n if (requiresBasicAuth(endpoint.url)) {\n const credentials = btoa(`${state.clientId}:${state.clientSecret}`);\n endpoint.headers.authorization = `basic ${credentials}`;\n return request(endpoint);\n }\n // TS makes us do this ¯\\_(ツ)_/¯\n const { token } = state.clientType === \"oauth-app\"\n ? await auth({ ...state, request })\n : await auth({ ...state, request });\n endpoint.headers.authorization = \"token \" + token;\n return request(endpoint);\n}\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { VERSION } from \"./version\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport { requiresBasicAuth } from \"./requires-basic-auth\";\nexport function createOAuthUserAuth({ clientId, clientSecret, clientType = \"oauth-app\", request = octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`,\n },\n}), ...strategyOptions }) {\n const state = Object.assign({\n clientType,\n clientId,\n clientSecret,\n strategyOptions,\n request,\n });\n // @ts-expect-error not worth the extra code needed to appease TS\n return Object.assign(auth.bind(null, state), {\n // @ts-expect-error not worth the extra code needed to appease TS\n hook: hook.bind(null, state),\n });\n}\ncreateOAuthUserAuth.VERSION = VERSION;\n"],"names":["request","octokitRequest"],"mappings":";;;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACA1C;AACA,AAEO,eAAe,iBAAiB,CAAC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AAE;AACb,QAAQ,YAAY,EAAE,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AAC9E,KAAK;AACL,CAAC,CAAC,EAAE,GAAG,eAAe,EAAE,EAAE;AAC1B,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AAChC,QAAQ,UAAU;AAClB,QAAQ,QAAQ;AAChB,QAAQ,YAAY;AACpB,QAAQ,eAAe;AACvB,iBAAQD,SAAO;AACf,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD;AACA,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;AACD,mBAAmB,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/auth-oauth-user/package.json b/node_modules/@octokit/auth-oauth-user/package.json
new file mode 100644
index 0000000..4979f07
--- /dev/null
+++ b/node_modules/@octokit/auth-oauth-user/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "@octokit/auth-oauth-user",
+ "description": "Octokit authentication strategy for OAuth clients",
+ "version": "1.3.0",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "api",
+ "sdk",
+ "toolkit"
+ ],
+ "repository": "https://github.com/octokit/auth-oauth-user.js",
+ "dependencies": {
+ "@octokit/auth-oauth-device": "^3.1.1",
+ "@octokit/oauth-methods": "^1.1.0",
+ "@octokit/request": "^5.4.14",
+ "@octokit/types": "^6.12.2",
+ "btoa-lite": "^1.0.0",
+ "universal-user-agent": "^6.0.0"
+ },
+ "peerDependencies": {},
+ "devDependencies": {
+ "@octokit/core": "^3.3.0",
+ "@octokit/tsconfig": "^1.0.2",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.2",
+ "@pika/plugin-build-web": "^0.9.2",
+ "@pika/plugin-ts-standard-pkg": "^0.9.2",
+ "@types/btoa-lite": "^1.0.0",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^14.14.33",
+ "fetch-mock": "^9.11.0",
+ "jest": "^27.0.0",
+ "mockdate": "^3.0.4",
+ "prettier": "2.3.1",
+ "semantic-release": "^17.4.1",
+ "semantic-release-plugin-update-version-in-files": "^1.1.0",
+ "ts-jest": "^27.0.0-next.12",
+ "typescript": "^4.2.3"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/oauth-authorization-url/LICENSE b/node_modules/@octokit/oauth-authorization-url/LICENSE
new file mode 100644
index 0000000..ef2c18e
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2019 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@octokit/oauth-authorization-url/README.md b/node_modules/@octokit/oauth-authorization-url/README.md
new file mode 100644
index 0000000..b032aa5
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/README.md
@@ -0,0 +1,281 @@
+# oauth-authorization-url.js
+
+> Universal library to retrieve GitHub’s identity URL for the OAuth web flow
+
+[![@latest](https://img.shields.io/npm/v/@octokit/oauth-authorization-url.svg)](https://www.npmjs.com/package/@octokit/oauth-authorization-url)
+[![Build Status](https://github.com/octokit/oauth-authorization-url.js/workflows/Test/badge.svg)](https://github.com/octokit/oauth-authorization-url.js/actions?query=workflow%3ATest+branch%3Amaster)
+
+See [GitHub’s Developer Guide for the OAuth App web application flow](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). Note that the [OAuth web application flow for GitHub Apps](https://docs.github.com/en/developers/apps/identifying-and-authorizing-users-for-github-apps#web-application-flow) is slightly different. GitHub Apps do not support scopes for its user access tokens (they are called user-to-server tokens for GitHub Apps), instead they inherit the user permissions from the GitHub App's registration and the repository/organization access and permissions from the respective installation.
+
+
+
+- [Usage](#usage)
+ - [For OAuth Apps](#for-oauth-apps)
+ - [For GitHub Apps](#for-github-apps)
+- [Options](#options)
+- [Result](#result)
+- [Types](#types)
+- [License](#license)
+
+
+
+## Usage
+
+
+
+
+
+ Browsers
+ |
+
+
+Load `@octokit/oauth-authorization-url` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+
+ Node
+ |
+
+
+Install with npm install @octokit/oauth-authorization-url
+
+```js
+const { oauthAuthorizationUrl } = require("@octokit/oauth-authorization-url");
+// or: import { oauthAuthorizationUrl } from "@octokit/oauth-authorization-url";
+```
+
+ |
+
+
+
+### For OAuth Apps
+
+```js
+const {
+ url,
+ clientId,
+ redirectUrl,
+ login,
+ scopes,
+ state,
+} = oauthAuthorizationUrl({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ redirectUrl: "https://example.com",
+ login: "octocat",
+ scopes: ["repo", "admin:org"],
+ state: "secret123",
+});
+```
+
+### For GitHub Apps
+
+```js
+const { url, clientId, redirectUrl, login, state } = oauthAuthorizationUrl({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ redirectUrl: "https://example.com",
+ login: "octocat",
+ state: "secret123",
+});
+```
+
+## Options
+
+
+
+
+
+ name
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ Required. The client ID you received from GitHub when you registered.
+ |
+
+
+
+ clientType
+ |
+
+
+Must be set to either `"oauth-app"` or `"github-app"`. Defaults to `"oauth-app"`.
+
+ |
+
+
+
+ redirectUrl
+ |
+
+ The URL in your application where users will be sent after authorization. See Redirect URLs in GitHub’s Developer Guide.
+ |
+
+
+
+ login
+ |
+
+ Suggests a specific account to use for signing in and authorizing the app.
+ |
+
+
+
+ scopes
+ |
+
+
+Only relevant when `clientType` is set to `"oauth-app"`.
+
+An array of scope names (or: space-delimited list of scopes). If not provided, scope defaults to an empty list for users that have not authorized any scopes for the application. For users who have authorized scopes for the application, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the set of scopes the user has authorized for the application. For example, if a user has already performed the web flow twice and has authorized one token with user scope and another token with repo scope, a third web flow that does not provide a scope will receive a token with user and repo scope.
+
+Defaults to `[]` if `clientType` is set to `"oauth-app"`.
+
+ |
+
+
+
+ state
+ |
+
+ An unguessable random string. It is used to protect against cross-site request forgery attacks.
+ Defaults to Math.random().toString(36).substr(2) .
+ |
+
+
+
+ allowSignup
+ |
+
+ Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. Use false in the case that a policy prohibits signups. Defaults to true .
+ |
+
+
+
+ baseUrl
+ |
+
+ When using GitHub Enterprise Server, set the baseUrl to the origin, e.g. https://github.my-enterprise.com .
+ |
+
+
+
+
+## Result
+
+`oauthAuthorizationUrl()` returns an object with the following properties
+
+
+
+
+
+ name
+ |
+
+ description
+ |
+
+
+
+
+
+ allowSignup
+ |
+
+ Returns options.allowSignup if it was set. Defaults to true .
+ |
+
+
+
+ clientType
+ |
+
+ Returns options.clientType . Defaults to "oauth-app" .
+ |
+
+
+
+ clientId
+ |
+
+ Returns options.clientId .
+ |
+
+
+
+ login
+ |
+
+ Returns options.login if it was set. Defaults to null .
+ |
+
+
+
+ redirectUrl
+ |
+
+ Returns options.redirectUrl if it was set. Defaults to null .
+ |
+
+
+
+ scopes
+ |
+
+
+Only set if `options.clientType` is set to `"oauth-app"`.
+
+Returns an array of strings. Returns options.scopes if it was set and turns the string into an array if a string was passed, otherwise [] .
+
+ |
+
+
+
+ state
+ |
+
+ Returns options.state if it was set. Defaults to Defaults to Math.random().toString(36).substr(2) .
+ |
+
+
+
+ url
+ |
+
+ The authorization URL
+ |
+
+
+
+
+## Types
+
+```ts
+import {
+ ClientType,
+ OAuthAppOptions,
+ OAuthAppResult,
+ GitHubAppOptions,
+ GitHubAppResult,
+} from "@octokit/oauth-authorization-url";
+```
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-node/index.js b/node_modules/@octokit/oauth-authorization-url/dist-node/index.js
new file mode 100644
index 0000000..a739ce7
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-node/index.js
@@ -0,0 +1,54 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function oauthAuthorizationUrl(options) {
+ const clientType = options.clientType || "oauth-app";
+ const baseUrl = options.baseUrl || "https://github.com";
+ const result = {
+ clientType,
+ allowSignup: options.allowSignup === false ? false : true,
+ clientId: options.clientId,
+ login: options.login || null,
+ redirectUrl: options.redirectUrl || null,
+ state: options.state || Math.random().toString(36).substr(2),
+ url: ""
+ };
+
+ if (clientType === "oauth-app") {
+ const scopes = "scopes" in options ? options.scopes : [];
+ result.scopes = typeof scopes === "string" ? scopes.split(/[,\s]+/).filter(Boolean) : scopes;
+ }
+
+ result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);
+ return result;
+}
+
+function urlBuilderAuthorize(base, options) {
+ const map = {
+ allowSignup: "allow_signup",
+ clientId: "client_id",
+ login: "login",
+ redirectUrl: "redirect_uri",
+ scopes: "scope",
+ state: "state"
+ };
+ let url = base;
+ Object.keys(map) // Filter out keys that are null and remove the url key
+ .filter(k => options[k] !== null) // Filter out empty scopes array
+ .filter(k => {
+ if (k !== "scopes") return true;
+ if (options.clientType === "github-app") return false;
+ return !Array.isArray(options[k]) || options[k].length > 0;
+ }) // Map Array with the proper URL parameter names and change the value to a string using template strings
+ // @ts-ignore
+ .map(key => [map[key], `${options[key]}`]) // Finally, build the URL
+ .forEach(([key, value], index) => {
+ url += index === 0 ? `?` : "&";
+ url += `${key}=${encodeURIComponent(value)}`;
+ });
+ return url;
+}
+
+exports.oauthAuthorizationUrl = oauthAuthorizationUrl;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-node/index.js.map b/node_modules/@octokit/oauth-authorization-url/dist-node/index.js.map
new file mode 100644
index 0000000..5072026
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["export function oauthAuthorizationUrl(options) {\n const clientType = options.clientType || \"oauth-app\";\n const baseUrl = options.baseUrl || \"https://github.com\";\n const result = {\n clientType,\n allowSignup: options.allowSignup === false ? false : true,\n clientId: options.clientId,\n login: options.login || null,\n redirectUrl: options.redirectUrl || null,\n state: options.state || Math.random().toString(36).substr(2),\n url: \"\",\n };\n if (clientType === \"oauth-app\") {\n const scopes = \"scopes\" in options ? options.scopes : [];\n result.scopes =\n typeof scopes === \"string\"\n ? scopes.split(/[,\\s]+/).filter(Boolean)\n : scopes;\n }\n result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);\n return result;\n}\nfunction urlBuilderAuthorize(base, options) {\n const map = {\n allowSignup: \"allow_signup\",\n clientId: \"client_id\",\n login: \"login\",\n redirectUrl: \"redirect_uri\",\n scopes: \"scope\",\n state: \"state\",\n };\n let url = base;\n Object.keys(map)\n // Filter out keys that are null and remove the url key\n .filter((k) => options[k] !== null)\n // Filter out empty scopes array\n .filter((k) => {\n if (k !== \"scopes\")\n return true;\n if (options.clientType === \"github-app\")\n return false;\n return !Array.isArray(options[k]) || options[k].length > 0;\n })\n // Map Array with the proper URL parameter names and change the value to a string using template strings\n // @ts-ignore\n .map((key) => [map[key], `${options[key]}`])\n // Finally, build the URL\n .forEach(([key, value], index) => {\n url += index === 0 ? `?` : \"&\";\n url += `${key}=${encodeURIComponent(value)}`;\n });\n return url;\n}\n"],"names":["oauthAuthorizationUrl","options","clientType","baseUrl","result","allowSignup","clientId","login","redirectUrl","state","Math","random","toString","substr","url","scopes","split","filter","Boolean","urlBuilderAuthorize","base","map","Object","keys","k","Array","isArray","length","key","forEach","value","index","encodeURIComponent"],"mappings":";;;;AAAO,SAASA,qBAAT,CAA+BC,OAA/B,EAAwC;AAC3C,QAAMC,UAAU,GAAGD,OAAO,CAACC,UAAR,IAAsB,WAAzC;AACA,QAAMC,OAAO,GAAGF,OAAO,CAACE,OAAR,IAAmB,oBAAnC;AACA,QAAMC,MAAM,GAAG;AACXF,IAAAA,UADW;AAEXG,IAAAA,WAAW,EAAEJ,OAAO,CAACI,WAAR,KAAwB,KAAxB,GAAgC,KAAhC,GAAwC,IAF1C;AAGXC,IAAAA,QAAQ,EAAEL,OAAO,CAACK,QAHP;AAIXC,IAAAA,KAAK,EAAEN,OAAO,CAACM,KAAR,IAAiB,IAJb;AAKXC,IAAAA,WAAW,EAAEP,OAAO,CAACO,WAAR,IAAuB,IALzB;AAMXC,IAAAA,KAAK,EAAER,OAAO,CAACQ,KAAR,IAAiBC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,MAA3B,CAAkC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D,IAAS,CAACP,GAAG,CAACO,GAAD,CAAJ,EAAY,GAAE3B,OAAO,CAAC2B,GAAD,CAAM,EAA3B,CAblB;AAAA,GAeKC,OAfL,CAea,CAAC,CAACD,GAAD,EAAME,KAAN,CAAD,EAAeC,KAAf,KAAyB;AAClCjB,IAAAA,GAAG,IAAIiB,KAAK,KAAK,CAAV,GAAe,GAAf,GAAoB,GAA3B;AACAjB,IAAAA,GAAG,IAAK,GAAEc,GAAI,IAAGI,kBAAkB,CAACF,KAAD,CAAQ,EAA3C;AACH,GAlBD;AAmBA,SAAOhB,GAAP;AACH;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-src/index.js b/node_modules/@octokit/oauth-authorization-url/dist-src/index.js
new file mode 100644
index 0000000..3a0be85
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-src/index.js
@@ -0,0 +1,53 @@
+export function oauthAuthorizationUrl(options) {
+ const clientType = options.clientType || "oauth-app";
+ const baseUrl = options.baseUrl || "https://github.com";
+ const result = {
+ clientType,
+ allowSignup: options.allowSignup === false ? false : true,
+ clientId: options.clientId,
+ login: options.login || null,
+ redirectUrl: options.redirectUrl || null,
+ state: options.state || Math.random().toString(36).substr(2),
+ url: "",
+ };
+ if (clientType === "oauth-app") {
+ const scopes = "scopes" in options ? options.scopes : [];
+ result.scopes =
+ typeof scopes === "string"
+ ? scopes.split(/[,\s]+/).filter(Boolean)
+ : scopes;
+ }
+ result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);
+ return result;
+}
+function urlBuilderAuthorize(base, options) {
+ const map = {
+ allowSignup: "allow_signup",
+ clientId: "client_id",
+ login: "login",
+ redirectUrl: "redirect_uri",
+ scopes: "scope",
+ state: "state",
+ };
+ let url = base;
+ Object.keys(map)
+ // Filter out keys that are null and remove the url key
+ .filter((k) => options[k] !== null)
+ // Filter out empty scopes array
+ .filter((k) => {
+ if (k !== "scopes")
+ return true;
+ if (options.clientType === "github-app")
+ return false;
+ return !Array.isArray(options[k]) || options[k].length > 0;
+ })
+ // Map Array with the proper URL parameter names and change the value to a string using template strings
+ // @ts-ignore
+ .map((key) => [map[key], `${options[key]}`])
+ // Finally, build the URL
+ .forEach(([key, value], index) => {
+ url += index === 0 ? `?` : "&";
+ url += `${key}=${encodeURIComponent(value)}`;
+ });
+ return url;
+}
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-src/types.js b/node_modules/@octokit/oauth-authorization-url/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-types/index.d.ts b/node_modules/@octokit/oauth-authorization-url/dist-types/index.d.ts
new file mode 100644
index 0000000..b4efd4a
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-types/index.d.ts
@@ -0,0 +1,4 @@
+import { OAuthAppOptions, GitHubAppOptions, OAuthAppResult, GitHubAppResult } from "./types";
+export { ClientType, OAuthAppOptions, GitHubAppOptions, OAuthAppResult, GitHubAppResult, } from "./types";
+export declare function oauthAuthorizationUrl(options: OAuthAppOptions): OAuthAppResult;
+export declare function oauthAuthorizationUrl(options: GitHubAppOptions): GitHubAppResult;
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-types/types.d.ts b/node_modules/@octokit/oauth-authorization-url/dist-types/types.d.ts
new file mode 100644
index 0000000..0dd3ad1
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-types/types.d.ts
@@ -0,0 +1,39 @@
+export declare type ClientType = "oauth-app" | "github-app";
+export declare type OAuthAppOptions = {
+ clientId: string;
+ clientType?: "oauth-app";
+ allowSignup?: boolean;
+ login?: string;
+ scopes?: string | string[];
+ redirectUrl?: string;
+ state?: string;
+ baseUrl?: string;
+};
+export declare type GitHubAppOptions = {
+ clientId: string;
+ clientType: "github-app";
+ allowSignup?: boolean;
+ login?: string;
+ redirectUrl?: string;
+ state?: string;
+ baseUrl?: string;
+};
+export declare type OAuthAppResult = {
+ allowSignup: boolean;
+ clientId: string;
+ clientType: "oauth-app";
+ login: string | null;
+ redirectUrl: string | null;
+ scopes: string[];
+ state: string;
+ url: string;
+};
+export declare type GitHubAppResult = {
+ allowSignup: boolean;
+ clientId: string;
+ clientType: "github-app";
+ login: string | null;
+ redirectUrl: string | null;
+ state: string;
+ url: string;
+};
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-web/index.js b/node_modules/@octokit/oauth-authorization-url/dist-web/index.js
new file mode 100644
index 0000000..e778a09
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-web/index.js
@@ -0,0 +1,56 @@
+function oauthAuthorizationUrl(options) {
+ const clientType = options.clientType || "oauth-app";
+ const baseUrl = options.baseUrl || "https://github.com";
+ const result = {
+ clientType,
+ allowSignup: options.allowSignup === false ? false : true,
+ clientId: options.clientId,
+ login: options.login || null,
+ redirectUrl: options.redirectUrl || null,
+ state: options.state || Math.random().toString(36).substr(2),
+ url: "",
+ };
+ if (clientType === "oauth-app") {
+ const scopes = "scopes" in options ? options.scopes : [];
+ result.scopes =
+ typeof scopes === "string"
+ ? scopes.split(/[,\s]+/).filter(Boolean)
+ : scopes;
+ }
+ result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);
+ return result;
+}
+function urlBuilderAuthorize(base, options) {
+ const map = {
+ allowSignup: "allow_signup",
+ clientId: "client_id",
+ login: "login",
+ redirectUrl: "redirect_uri",
+ scopes: "scope",
+ state: "state",
+ };
+ let url = base;
+ Object.keys(map)
+ // Filter out keys that are null and remove the url key
+ .filter((k) => options[k] !== null)
+ // Filter out empty scopes array
+ .filter((k) => {
+ if (k !== "scopes")
+ return true;
+ if (options.clientType === "github-app")
+ return false;
+ return !Array.isArray(options[k]) || options[k].length > 0;
+ })
+ // Map Array with the proper URL parameter names and change the value to a string using template strings
+ // @ts-ignore
+ .map((key) => [map[key], `${options[key]}`])
+ // Finally, build the URL
+ .forEach(([key, value], index) => {
+ url += index === 0 ? `?` : "&";
+ url += `${key}=${encodeURIComponent(value)}`;
+ });
+ return url;
+}
+
+export { oauthAuthorizationUrl };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/oauth-authorization-url/dist-web/index.js.map b/node_modules/@octokit/oauth-authorization-url/dist-web/index.js.map
new file mode 100644
index 0000000..cad5e93
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["export function oauthAuthorizationUrl(options) {\n const clientType = options.clientType || \"oauth-app\";\n const baseUrl = options.baseUrl || \"https://github.com\";\n const result = {\n clientType,\n allowSignup: options.allowSignup === false ? false : true,\n clientId: options.clientId,\n login: options.login || null,\n redirectUrl: options.redirectUrl || null,\n state: options.state || Math.random().toString(36).substr(2),\n url: \"\",\n };\n if (clientType === \"oauth-app\") {\n const scopes = \"scopes\" in options ? options.scopes : [];\n result.scopes =\n typeof scopes === \"string\"\n ? scopes.split(/[,\\s]+/).filter(Boolean)\n : scopes;\n }\n result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);\n return result;\n}\nfunction urlBuilderAuthorize(base, options) {\n const map = {\n allowSignup: \"allow_signup\",\n clientId: \"client_id\",\n login: \"login\",\n redirectUrl: \"redirect_uri\",\n scopes: \"scope\",\n state: \"state\",\n };\n let url = base;\n Object.keys(map)\n // Filter out keys that are null and remove the url key\n .filter((k) => options[k] !== null)\n // Filter out empty scopes array\n .filter((k) => {\n if (k !== \"scopes\")\n return true;\n if (options.clientType === \"github-app\")\n return false;\n return !Array.isArray(options[k]) || options[k].length > 0;\n })\n // Map Array with the proper URL parameter names and change the value to a string using template strings\n // @ts-ignore\n .map((key) => [map[key], `${options[key]}`])\n // Finally, build the URL\n .forEach(([key, value], index) => {\n url += index === 0 ? `?` : \"&\";\n url += `${key}=${encodeURIComponent(value)}`;\n });\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end of file
diff --git a/node_modules/@octokit/oauth-authorization-url/package.json b/node_modules/@octokit/oauth-authorization-url/package.json
new file mode 100644
index 0000000..e059406
--- /dev/null
+++ b/node_modules/@octokit/oauth-authorization-url/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@octokit/oauth-authorization-url",
+ "description": "Universal library to retrieve GitHubâs identity URL for the OAuth web flow",
+ "version": "4.3.3",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "octokit",
+ "github",
+ "oauth"
+ ],
+ "repository": "github:octokit/oauth-authorization-url.js",
+ "dependencies": {},
+ "devDependencies": {
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.0",
+ "@pika/plugin-build-web": "^0.9.0",
+ "@pika/plugin-ts-standard-pkg": "^0.9.0",
+ "@types/jest": "^26.0.0",
+ "jest": "^27.0.0",
+ "pika-plugin-unpkg-field": "^1.0.1",
+ "semantic-release": "^17.0.0",
+ "ts-jest": "^27.0.0-next.12",
+ "typescript": "^4.0.2"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js",
+ "unpkg": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/oauth-methods/LICENSE b/node_modules/@octokit/oauth-methods/LICENSE
new file mode 100644
index 0000000..57049d0
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/LICENSE
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) 2021 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@octokit/oauth-methods/README.md b/node_modules/@octokit/oauth-methods/README.md
new file mode 100644
index 0000000..acaac06
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/README.md
@@ -0,0 +1,1607 @@
+# oauth-methods.js
+
+> Set of stateless request methods to create, check, reset, refresh, and delete user access tokens for OAuth and GitHub Apps
+
+[![@latest](https://img.shields.io/npm/v/@octokit/oauth-methods.svg)](https://www.npmjs.com/package/@octokit/oauth-methods)
+[![Build Status](https://github.com/octokit/oauth-methods.js/workflows/Test/badge.svg)](https://github.com/octokit/oauth-methods.js/actions?query=workflow%3ATest+branch%3Amain)
+
+
+
+- [Usage](#usage)
+ - [OAuth Web Flow](#oauth-web-flow)
+ - [OAuth Device Flow](#oauth-device-flow)
+- [Methods](#methods)
+ - [`getWebFlowAuthorizationUrl()`](#getwebflowauthorizationurl)
+ - [`exchangeWebFlowCode()`](#exchangewebflowcode)
+ - [`createDeviceCode()`](#createdevicecode)
+ - [`exchangeDeviceCode()`](#exchangedevicecode)
+ - [`checkToken()`](#checktoken)
+ - [`refreshToken()`](#refreshtoken)
+ - [`scopeToken()`](#scopetoken)
+ - [`resetToken()`](#resettoken)
+ - [`deleteToken()`](#deletetoken)
+ - [`deleteAuthorization()`](#deleteauthorization)
+- [Authentication object](#authentication-object)
+ - [OAuth APP authentication](#oauth-app-authentication)
+ - [GitHub App with non-expiring user authentication](#github-app-with-non-expiring-user-authentication)
+ - [GitHub App with expiring user authentication](#github-app-with-expiring-user-authentication)
+- [Types](#types)
+- [Contributing](#contributing)
+- [License](#license)
+
+
+
+The OAuth endpoints related to user access tokens are not all part of GitHub's REST API and they behave slightly different. The methods exported by `@octokit/normalize the differences so you don't have to.
+
+## Usage
+
+
+
+
+
+Browsers
+
+ |
+
+`@octokit/oauth-methods` is not meant for browser usage.
+
+Some of the methods will work, but others do not have CORS headers enabled and will fail (`exchangeWebFlowCode()`, `createDeviceCode()`, `exchangeDeviceCode()`, `refreshToken()`). Also the Client Secret should not be exposed to clients as it can be used for a [Person-in-the-middle attack](https://en.wikipedia.org/wiki/Person-in-the-middle_attack).
+
+ |
+
+
+Node
+
+ |
+
+Install with `npm install @octokit/core @octokit/oauth-methods`
+
+```js
+const {
+ exchangeWebFlowCode,
+ createDeviceCode,
+ exchangeDeviceCode,
+ checkToken,
+ refreshToken,
+ scopeToken,
+ resetToken,
+ deleteToken,
+ deleteAuthorization,
+} = require("@octokit/oauth-methods");
+```
+
+ |
+
+
+
+### OAuth Web Flow
+
+After a user granted access to an OAuth App or GitHub App on [Step 1 of GitHub's OAuth Web Flow](https://docs.github.com/en/developers/apps/identifying-and-authorizing-users-for-github-apps#1-request-a-users-github-identity), they get redirected to a URL controlled by your app with a `?code=...` query parameter.
+
+You can exchange that code for a user access token as described in [Step 2 of GitHub's OAuth Web Flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github).
+
+Setting `clientType` is required because there are slight differences between `"oauth-app"` and `"github-app"`. Most importantly, GitHub Apps do not support scopes.
+
+```js
+const { data, authentication } = await exchangeWebFlowCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ code: "code123",
+ scopes: ["repo"],
+});
+```
+
+`data` is the raw response data. `authentication` is a [User Authentication object](#authentication-object).
+
+### OAuth Device Flow
+
+In [step 1 of GitHub's OAuth Device Flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github), you need to create a device and user code
+
+```js
+const {
+ data: { device_code, user_code, verification_uri },
+} = await createDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["repo"],
+});
+```
+
+In [step 2 of GitHub's OAuth Device Flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser), the user has to enter `user_code` on `verification_uri` (https://github.com/login/device unless you use GitHub Enterprise Server).
+
+Once the user entered the code and granted access, you can exchange the `device_code` for a user access token in [step 3 of GitHub's OAuth Device Flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device)
+
+```js
+const { data, authentication } = await exchangeDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ code: device_code,
+});
+```
+
+`data` is the raw response data. `authentication` is a [User Authentication object](#authentication-object).
+
+## Methods
+
+### `getWebFlowAuthorizationUrl()`
+
+This is a wrapper around [`@octokit/oauth-authorization-url`](https://github.com/octokit/oauth-authorization-url.js#readme) that accepts a `request` option instead of `baseUrl` for consistency with the other OAuth methods. `getWebFlowAuthorizationUrl()` is a synchronous method and does not send any request.
+
+```js
+const { url } = getWebFlowAuthorizationUrl({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["repo"],
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. The client ID you received from GitHub when you registered.
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to either "oauth-app" or "github-app" .
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+ The URL in your application where users will be sent after authorization. See Redirect URLs in GitHub’s Developer Guide.
+ |
+
+
+
+ login
+ |
+
+ string
+ |
+
+ Suggests a specific account to use for signing in and authorizing the app.
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+
+Only relevant if `clientType` is set to `"oauth-app"`.
+
+An array of scope names (or: space-delimited list of scopes). If not provided, scope defaults to an empty list for users that have not authorized any scopes for the application. For users who have authorized scopes for the application, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the set of scopes the user has authorized for the application. For example, if a user has already performed the web flow twice and has authorized one token with user scope and another token with repo scope, a third web flow that does not provide a scope will receive a token with user and repo scope.
+
+Defaults to `[]`.
+
+ |
+
+
+
+ state
+ |
+
+ string
+ |
+
+ An unguessable random string. It is used to protect against cross-site request forgery attacks.
+ Defaults to Math.random().toString(36).substr(2) .
+ |
+
+
+
+ allowSignup
+ |
+
+ boolean
+ |
+
+ Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. Use false in the case that a policy prohibits signups. Defaults to true .
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { url } = getWebFlowAuthorizationUrl({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["repo"],
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+The `getWebFlowAuthorizationUrl` method is synchronous and returns an object with the following properties.
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ allowSignup
+ |
+
+ boolean
+ |
+
+ Returns options.allowSignup if it was set. Defaults to true .
+ |
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Returns options.clientType
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Returns options.clientId .
+ |
+
+
+
+ login
+ |
+
+ string
+ |
+
+ Returns options.login if it was set. Defaults to null .
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+ Returns options.redirectUrl if it was set. Defaults to null .
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+
+Only set if `options.clientType` is set to `"oauth-app"`.
+
+Returns an array of strings. Returns options.scopes if it was set and turns the string into an array if a string was passed, otherwise [] .
+
+ |
+
+
+
+ state
+ |
+
+ string
+ |
+
+ Returns options.state if it was set. Defaults to Math.random().toString(36).substr(2) .
+ |
+
+
+
+ url
+ |
+
+ string
+ |
+
+ The authorization URL
+ |
+
+
+
+
+### `exchangeWebFlowCode()`
+
+```js
+const { data, authentication } = await exchangeWebFlowCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ code: "code123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to either "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ code
+ |
+
+ string
+ |
+
+ Required. The code from GitHub's OAuth flow redirect's ?code=... query parameter
+ |
+
+
+
+ redirectUrl
+ |
+
+ string
+ |
+
+ The redirectUrl option you passed to getWebFlowAuthorizationUrl()
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await exchangeWebFlowCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ code: "code123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST /login/oauth/access_token`](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#response) (JSON) with an additional `authentication` key which is the [authentication object](#authentication-object).
+
+### `createDeviceCode()`
+
+```js
+const { data, authentication } = await createDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["repo"],
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to either "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+
+Only permitted if `clientType` is set to `"oauth-app"`. GitHub Apps do not support scopes.
+
+Array of [scope names](https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes) you want to request for the user access token.
+
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data } = await createDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ scopes: ["repo"],
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST https://github.com/login/device/code`](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#response-1) (JSON).
+
+### `exchangeDeviceCode()`
+
+```js
+const { data, authentication } = await exchangeDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ code: "code123",
+});
+```
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to either "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ code
+ |
+
+ string
+ |
+
+ Required. The decive_code from the createDeviceCode() response
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await exchangeDeviceCode({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ code: "code123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+### `checkToken()`
+
+```js
+const { data, authentication } = await checkToken({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to either "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ Required. The user access token to check
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await checkToken({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#check-a-token) with an additional `authentication` key which is the [authentication object](#authentication-object). Note that the `authentication` object will not include the keys for expiring authentication.
+
+### `refreshToken()`
+
+Expiring user access tokens are currently in preview. You can [enable them for any of your GitHub apps](https://docs.github.com/en/developers/apps/refreshing-user-to-server-access-tokens#configuring-expiring-user-tokens-for-an-existing-github-app). OAuth Apps do not support expiring user access tokens
+
+When a user access token expires it can be [refreshed using a refresh token](https://docs.github.com/en/developers/apps/refreshing-user-to-server-access-tokens). Refreshing a token invalidates the current user access token.
+
+```js
+const { data, authentication } = await refreshToken({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ refreshToken: "r1.refreshtoken123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Must be set to "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ Required. The refresh token that was received alongside the user access token.
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await refreshToken({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ refreshToken: "r1.refreshtoken123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST /login/oauth/access_token`](https://docs.github.com/en/developers/apps/refreshing-user-to-server-access-tokens#response) with an additional `authentication` key which is the [GitHub App expiring user authentication](#github-app-with-expiring-user-authentication).
+
+### `scopeToken()`
+
+```js
+const { data, authentication } = await scopeToken({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+ target: "octokit",
+ repositories: ["oauth-methods.js"],
+ permissions: {
+ issues: "write",
+ },
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Required. Must be set to "github-app" .
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ target
+ |
+
+ string
+ |
+
+ Required unless targetId is set. The name of the user or organization to scope the user-to-server access token to.
+ |
+
+
+
+ targetId
+ |
+
+ integer
+ |
+
+ Required unless target is set. The ID of the user or organization to scope the user-to-server access token to.
+ |
+
+
+
+ repositories
+ |
+
+ array of strings
+ |
+
+ The list of repository names to scope the user-to-server access token to. repositories may not be specified if repository_ids is specified.
+ |
+
+
+
+ repository_ids
+ |
+
+ array of integers
+ |
+
+ The list of repository IDs to scope the user-to-server access token to. repositories may not be specified if repositories is specified.
+ |
+
+
+
+ permissions
+ |
+
+ object
+ |
+
+ The permissions granted to the user-to-server access token. See GitHub App Permissions.
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await scopeToken({
+ clientType: "github-app",
+ clientId: "lv1.1234567890abcdef",
+ token: "usertoken123",
+ target: "octokit",
+ repositories: ["oauth-methods.js"],
+ permissions: {
+ issues: "write",
+ },
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST /applications/{client_id}/token/scoped`](https://docs.github.com/en/rest/reference/apps#create-a-scoped-access-token) with an additional `authentication` key which is the new [authentication object](#authentication-object).
+
+### `resetToken()`
+
+```js
+const { data, authentication } = await resetToken({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Must be set to "oauth-app" or "github-app" .
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ Required. The user access token to reset
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await resetToken({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "secret",
+ token: "usertoken123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`POST /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#reset-a-token) with an additional `authentication` key which is the new [authentication object](#authentication-object).
+
+### `deleteToken()`
+
+```js
+const { status } = await deleteToken({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Must be set to "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ Required. The user access token to delete
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await deleteToken({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "secret",
+ token: "usertoken123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`DELETE /applications/{client_id}/token`](https://docs.github.com/en/rest/reference/apps#delete-an-app-token) (which is an empty `204` response).
+
+### `deleteAuthorization()`
+
+```js
+const { status } = await deleteAuthorization({
+ clientType: "oauth-app",
+ clientId: "1234567890abcdef1234",
+ clientSecret: "1234567890abcdef12347890abcdef12345678",
+ token: "usertoken123",
+});
+```
+
+Options
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ Must be set to "oauth-app" or "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ Required. Your app's client ID
+ |
+
+
+
+ clientSecret
+ |
+
+ string
+ |
+
+ Required. One of your app's client secrets
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ Required. A valid user access token for the authorization
+ |
+
+
+
+ request
+ |
+
+ function
+ |
+
+ You can pass in your own @octokit/request instance. For usage with enterprise, set baseUrl to the REST API root endpoint. Example:
+
+```js
+const { request } = require("@octokit/request");
+const { data, authentication } = await deleteAuthorization({
+ clientId: "1234567890abcdef1234",
+ clientSecret: "secret",
+ token: "usertoken123",
+ request: request.defaults({
+ baseUrl: "https://ghe.my-company.com/api/v3",
+ }),
+});
+```
+
+ |
+
+
+
+
+Resolves with an [`@octokit/request` response object](https://github.com/octokit/request.js/#request) for [`DELETE /applications/{client_id}/grant`](https://docs.github.com/en/rest/reference/apps#delete-an-app-authorization) (which is an empty `204` response).
+
+## Authentication object
+
+The `authentication` object returned by the methods have one of three formats.
+
+1. [OAuth APP authentication token](#oauth-app-authentication-token)
+1. [GitHub APP non-expiring user authentication token with expiring disabled](#github-app-user-authentication-token-with-expiring-disabled)
+1. [GitHub APP user authentication token with expiring enabled](#github-app-user-authentication-token-with-expiring-enabled)
+
+The differences are
+
+1. `scopes` is only present for OAuth Apps
+2. `refreshToken`, `expiresAt`, `refreshTokenExpiresAt` are only present for GitHub Apps, and only if token expiration is enabled
+
+Note that the `clientSecret` may not be set when using [`exchangeDeviceCode()`](#exchangedevicecode) as `clientSecret` is not required for the OAuth device flow.
+
+### OAuth APP authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "oauth-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ scopes
+ |
+
+ array of strings
+ |
+
+ array of scope names enabled for the token
+ |
+
+
+
+
+### GitHub App with non-expiring user authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+
+### GitHub App with expiring user authentication
+
+
+
+
+
+ name
+ |
+
+ type
+ |
+
+ description
+ |
+
+
+
+
+
+ clientType
+ |
+
+ string
+ |
+
+ "github-app"
+ |
+
+
+
+ clientId
+ |
+
+ string
+ |
+
+ The app's Client ID
+ |
+
+
+
+ token
+ |
+
+ string
+ |
+
+ The user access token
+ |
+
+
+
+ refreshToken
+ |
+
+ string
+ |
+
+ The refresh token
+ |
+
+
+
+ expiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2022-01-01T08:00:0.000Z
+ |
+
+
+
+ refreshTokenExpiresAt
+ |
+
+ string
+ |
+
+ Date timestamp in ISO 8601 standard. Example: 2021-07-01T00:00:0.000Z
+ |
+
+
+
+
+## Types
+
+```ts
+import {
+ OAuthAppAuthentication,
+ GitHubAppAuthentication,
+ GitHubAppAuthenticationWithExpiration,
+ GetWebFlowAuthorizationUrlOAuthAppOptions,
+ GetWebFlowAuthorizationUrlGitHubAppOptions,
+ GetWebFlowAuthorizationUrlOAuthAppResult,
+ GetWebFlowAuthorizationUrlGitHubAppResult,
+ CheckTokenOAuthAppOptions,
+ CheckTokenGitHubAppOptions,
+ CheckTokenOAuthAppResponse,
+ CheckTokenGitHubAppResponse,
+ ExchangeWebFlowCodeOAuthAppOptions,
+ ExchangeWebFlowCodeGitHubAppOptions,
+ ExchangeWebFlowCodeOAuthAppResponse,
+ ExchangeWebFlowCodeGitHubAppResponse,
+ CreateDeviceCodeOAuthAppOptions,
+ CreateDeviceCodeGitHubAppOptions,
+ CreateDeviceCodeDeviceTokenResponse,
+ ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret,
+ ExchangeDeviceCodeOAuthAppOptions,
+ ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret,
+ ExchangeDeviceCodeGitHubAppOptions,
+ ExchangeDeviceCodeOAuthAppResponse,
+ ExchangeDeviceCodeOAuthAppResponseWithoutClientSecret,
+ ExchangeDeviceCodeGitHubAppResponse,
+ ExchangeDeviceCodeGitHubAppResponseWithoutClientSecret,
+ RefreshTokenOptions,
+ RefreshTokenResponse,
+ ScopeTokenOptions,
+ ScopeTokenResponse,
+ ResetTokenOAuthAppOptions,
+ ResetTokenGitHubAppOptions,
+ ResetTokenOAuthAppResponse,
+ ResetTokenGitHubAppResponse,
+ DeleteTokenOAuthAppOptions,
+ DeleteTokenGitHubAppOptions,
+ DeleteTokenResponse,
+ DeleteAuthorizationOAuthAppOptions,
+ DeleteAuthorizationGitHubAppOptions,
+ DeleteAuthorizationResponse,
+} from "@octokit/oauth-methods";
+```
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md)
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/oauth-methods/dist-node/index.js b/node_modules/@octokit/oauth-methods/dist-node/index.js
new file mode 100644
index 0000000..0881cf6
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-node/index.js
@@ -0,0 +1,393 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
+
+var oauthAuthorizationUrl = require('@octokit/oauth-authorization-url');
+var request = require('@octokit/request');
+var requestError = require('@octokit/request-error');
+var btoa = _interopDefault(require('btoa-lite'));
+
+const VERSION = "1.2.6";
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+
+ if (enumerableOnly) {
+ symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ }
+
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+
+ var key, i;
+
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+function requestToOAuthBaseUrl(request) {
+ const endpointDefaults = request.endpoint.DEFAULTS;
+ return /^https:\/\/(api\.)?github\.com$/.test(endpointDefaults.baseUrl) ? "https://github.com" : endpointDefaults.baseUrl.replace("/api/v3", "");
+}
+async function oauthRequest(request, route, parameters) {
+ const withOAuthParameters = _objectSpread2({
+ baseUrl: requestToOAuthBaseUrl(request),
+ headers: {
+ accept: "application/json"
+ }
+ }, parameters);
+
+ const response = await request(route, withOAuthParameters);
+
+ if ("error" in response.data) {
+ const error = new requestError.RequestError(`${response.data.error_description} (${response.data.error}, ${response.data.error_uri})`, 400, {
+ request: request.endpoint.merge(route, withOAuthParameters),
+ headers: response.headers
+ }); // @ts-ignore add custom response property until https://github.com/octokit/request-error.js/issues/169 is resolved
+
+ error.response = response;
+ throw error;
+ }
+
+ return response;
+}
+
+const _excluded = ["request"];
+function getWebFlowAuthorizationUrl(_ref) {
+ let {
+ request: request$1 = request.request
+ } = _ref,
+ options = _objectWithoutProperties(_ref, _excluded);
+
+ const baseUrl = requestToOAuthBaseUrl(request$1); // @ts-expect-error TypeScript wants `clientType` to be set explicitly ¯\_(ツ)_/¯
+
+ return oauthAuthorizationUrl.oauthAuthorizationUrl(_objectSpread2(_objectSpread2({}, options), {}, {
+ baseUrl
+ }));
+}
+
+async function exchangeWebFlowCode(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const response = await oauthRequest(request$1, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ client_secret: options.clientSecret,
+ code: options.code,
+ redirect_uri: options.redirectUrl
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.access_token,
+ scopes: response.data.scope.split(/\s+/).filter(Boolean)
+ };
+
+ if (options.clientType === "github-app") {
+ if ("refresh_token" in response.data) {
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ authentication.refreshToken = response.data.refresh_token, authentication.expiresAt = toTimestamp(apiTimeInMs, response.data.expires_in), authentication.refreshTokenExpiresAt = toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in);
+ }
+
+ delete authentication.scopes;
+ }
+
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+function toTimestamp(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
+
+async function createDeviceCode(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const parameters = {
+ client_id: options.clientId
+ };
+
+ if ("scopes" in options && Array.isArray(options.scopes)) {
+ parameters.scope = options.scopes.join(" ");
+ }
+
+ return oauthRequest(request$1, "POST /login/device/code", parameters);
+}
+
+async function exchangeDeviceCode(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const response = await oauthRequest(request$1, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ device_code: options.code,
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code"
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ token: response.data.access_token,
+ scopes: response.data.scope.split(/\s+/).filter(Boolean)
+ };
+
+ if ("clientSecret" in options) {
+ authentication.clientSecret = options.clientSecret;
+ }
+
+ if (options.clientType === "github-app") {
+ if ("refresh_token" in response.data) {
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ authentication.refreshToken = response.data.refresh_token, authentication.expiresAt = toTimestamp$1(apiTimeInMs, response.data.expires_in), authentication.refreshTokenExpiresAt = toTimestamp$1(apiTimeInMs, response.data.refresh_token_expires_in);
+ }
+
+ delete authentication.scopes;
+ }
+
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+function toTimestamp$1(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
+
+async function checkToken(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const response = await request$1("POST /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${btoa(`${options.clientId}:${options.clientSecret}`)}`
+ },
+ client_id: options.clientId,
+ access_token: options.token
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: options.token,
+ scopes: response.data.scopes
+ };
+ if (response.data.expires_at) authentication.expiresAt = response.data.expires_at;
+
+ if (options.clientType === "github-app") {
+ delete authentication.scopes;
+ }
+
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+async function refreshToken(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const response = await oauthRequest(request$1, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ client_secret: options.clientSecret,
+ grant_type: "refresh_token",
+ refresh_token: options.refreshToken
+ });
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ const authentication = {
+ clientType: "github-app",
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.access_token,
+ refreshToken: response.data.refresh_token,
+ expiresAt: toTimestamp$2(apiTimeInMs, response.data.expires_in),
+ refreshTokenExpiresAt: toTimestamp$2(apiTimeInMs, response.data.refresh_token_expires_in)
+ };
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+function toTimestamp$2(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
+
+const _excluded$1 = ["request", "clientType", "clientId", "clientSecret", "token"];
+async function scopeToken(options) {
+ const {
+ request: request$1,
+ clientType,
+ clientId,
+ clientSecret,
+ token
+ } = options,
+ requestOptions = _objectWithoutProperties(options, _excluded$1);
+
+ const response = await (request$1 ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request)("POST /applications/{client_id}/token/scoped", _objectSpread2({
+ headers: {
+ authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`
+ },
+ client_id: clientId,
+ access_token: token
+ }, requestOptions));
+ const authentication = Object.assign({
+ clientType,
+ clientId,
+ clientSecret,
+ token: response.data.token
+ }, response.data.expires_at ? {
+ expiresAt: response.data.expires_at
+ } : {});
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+async function resetToken(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ const response = await request$1("PATCH /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${auth}`
+ },
+ client_id: options.clientId,
+ access_token: options.token
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.token,
+ scopes: response.data.scopes
+ };
+ if (response.data.expires_at) authentication.expiresAt = response.data.expires_at;
+
+ if (options.clientType === "github-app") {
+ delete authentication.scopes;
+ }
+
+ return _objectSpread2(_objectSpread2({}, response), {}, {
+ authentication
+ });
+}
+
+async function deleteToken(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ return request$1("DELETE /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${auth}`
+ },
+ client_id: options.clientId,
+ access_token: options.token
+ });
+}
+
+async function deleteAuthorization(options) {
+ const request$1 = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ request.request;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ return request$1("DELETE /applications/{client_id}/grant", {
+ headers: {
+ authorization: `basic ${auth}`
+ },
+ client_id: options.clientId,
+ access_token: options.token
+ });
+}
+
+exports.VERSION = VERSION;
+exports.checkToken = checkToken;
+exports.createDeviceCode = createDeviceCode;
+exports.deleteAuthorization = deleteAuthorization;
+exports.deleteToken = deleteToken;
+exports.exchangeDeviceCode = exchangeDeviceCode;
+exports.exchangeWebFlowCode = exchangeWebFlowCode;
+exports.getWebFlowAuthorizationUrl = getWebFlowAuthorizationUrl;
+exports.refreshToken = refreshToken;
+exports.resetToken = resetToken;
+exports.scopeToken = scopeToken;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/oauth-methods/dist-node/index.js.map b/node_modules/@octokit/oauth-methods/dist-node/index.js.map
new file mode 100644
index 0000000..19669f0
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/utils.js","../dist-src/get-web-flow-authorization-url.js","../dist-src/exchange-web-flow-code.js","../dist-src/create-device-code.js","../dist-src/exchange-device-code.js","../dist-src/check-token.js","../dist-src/refresh-token.js","../dist-src/scope-token.js","../dist-src/reset-token.js","../dist-src/delete-token.js","../dist-src/delete-authorization.js"],"sourcesContent":["export const VERSION = \"1.2.6\";\n","import { RequestError } from \"@octokit/request-error\";\nexport function requestToOAuthBaseUrl(request) {\n const endpointDefaults = request.endpoint.DEFAULTS;\n return /^https:\\/\\/(api\\.)?github\\.com$/.test(endpointDefaults.baseUrl)\n ? \"https://github.com\"\n : endpointDefaults.baseUrl.replace(\"/api/v3\", \"\");\n}\nexport async function oauthRequest(request, route, parameters) {\n const withOAuthParameters = {\n baseUrl: requestToOAuthBaseUrl(request),\n headers: {\n accept: \"application/json\",\n },\n ...parameters,\n };\n const response = await request(route, withOAuthParameters);\n if (\"error\" in response.data) {\n const error = new RequestError(`${response.data.error_description} (${response.data.error}, ${response.data.error_uri})`, 400, {\n request: request.endpoint.merge(route, withOAuthParameters),\n headers: response.headers,\n });\n // @ts-ignore add custom response property until https://github.com/octokit/request-error.js/issues/169 is resolved\n error.response = response;\n throw error;\n }\n return response;\n}\n","import { oauthAuthorizationUrl, } from \"@octokit/oauth-authorization-url\";\nimport { request as defaultRequest } from \"@octokit/request\";\nimport { requestToOAuthBaseUrl } from \"./utils\";\nexport function getWebFlowAuthorizationUrl({ request = defaultRequest, ...options }) {\n const baseUrl = requestToOAuthBaseUrl(request);\n // @ts-expect-error TypeScript wants `clientType` to be set explicitly ¯\\_(ツ)_/¯\n return oauthAuthorizationUrl({\n ...options,\n baseUrl,\n });\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport { oauthRequest } from \"./utils\";\nexport async function exchangeWebFlowCode(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const response = await oauthRequest(request, \"POST /login/oauth/access_token\", {\n client_id: options.clientId,\n client_secret: options.clientSecret,\n code: options.code,\n redirect_uri: options.redirectUrl,\n });\n const authentication = {\n clientType: options.clientType,\n clientId: options.clientId,\n clientSecret: options.clientSecret,\n token: response.data.access_token,\n scopes: response.data.scope.split(/\\s+/).filter(Boolean),\n };\n if (options.clientType === \"github-app\") {\n if (\"refresh_token\" in response.data) {\n const apiTimeInMs = new Date(response.headers.date).getTime();\n (authentication.refreshToken = response.data.refresh_token),\n (authentication.expiresAt = toTimestamp(apiTimeInMs, response.data.expires_in)),\n (authentication.refreshTokenExpiresAt = toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in));\n }\n delete authentication.scopes;\n }\n return { ...response, authentication };\n}\nfunction toTimestamp(apiTimeInMs, expirationInSeconds) {\n return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport { oauthRequest } from \"./utils\";\nexport async function createDeviceCode(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const parameters = {\n client_id: options.clientId,\n };\n if (\"scopes\" in options && Array.isArray(options.scopes)) {\n parameters.scope = options.scopes.join(\" \");\n }\n return oauthRequest(request, \"POST /login/device/code\", parameters);\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport { oauthRequest } from \"./utils\";\nexport async function exchangeDeviceCode(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const response = await oauthRequest(request, \"POST /login/oauth/access_token\", {\n client_id: options.clientId,\n device_code: options.code,\n grant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n });\n const authentication = {\n clientType: options.clientType,\n clientId: options.clientId,\n token: response.data.access_token,\n scopes: response.data.scope.split(/\\s+/).filter(Boolean),\n };\n if (\"clientSecret\" in options) {\n authentication.clientSecret = options.clientSecret;\n }\n if (options.clientType === \"github-app\") {\n if (\"refresh_token\" in response.data) {\n const apiTimeInMs = new Date(response.headers.date).getTime();\n (authentication.refreshToken = response.data.refresh_token),\n (authentication.expiresAt = toTimestamp(apiTimeInMs, response.data.expires_in)),\n (authentication.refreshTokenExpiresAt = toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in));\n }\n delete authentication.scopes;\n }\n return { ...response, authentication };\n}\nfunction toTimestamp(apiTimeInMs, expirationInSeconds) {\n return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport btoa from \"btoa-lite\";\nexport async function checkToken(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const response = await request(\"POST /applications/{client_id}/token\", {\n headers: {\n authorization: `basic ${btoa(`${options.clientId}:${options.clientSecret}`)}`,\n },\n client_id: options.clientId,\n access_token: options.token,\n });\n const authentication = {\n clientType: options.clientType,\n clientId: options.clientId,\n clientSecret: options.clientSecret,\n token: options.token,\n scopes: response.data.scopes,\n };\n if (response.data.expires_at)\n authentication.expiresAt = response.data.expires_at;\n if (options.clientType === \"github-app\") {\n delete authentication.scopes;\n }\n return { ...response, authentication };\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport { oauthRequest } from \"./utils\";\nexport async function refreshToken(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const response = await oauthRequest(request, \"POST /login/oauth/access_token\", {\n client_id: options.clientId,\n client_secret: options.clientSecret,\n grant_type: \"refresh_token\",\n refresh_token: options.refreshToken,\n });\n const apiTimeInMs = new Date(response.headers.date).getTime();\n const authentication = {\n clientType: \"github-app\",\n clientId: options.clientId,\n clientSecret: options.clientSecret,\n token: response.data.access_token,\n refreshToken: response.data.refresh_token,\n expiresAt: toTimestamp(apiTimeInMs, response.data.expires_in),\n refreshTokenExpiresAt: toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in),\n };\n return { ...response, authentication };\n}\nfunction toTimestamp(apiTimeInMs, expirationInSeconds) {\n return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport btoa from \"btoa-lite\";\nexport async function scopeToken(options) {\n const { request, clientType, clientId, clientSecret, token, ...requestOptions } = options;\n const response = await (request ||\n /* istanbul ignore next: we always pass a custom request in tests */ defaultRequest)(\"POST /applications/{client_id}/token/scoped\", {\n headers: {\n authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`,\n },\n client_id: clientId,\n access_token: token,\n ...requestOptions,\n });\n const authentication = Object.assign({\n clientType,\n clientId,\n clientSecret,\n token: response.data.token,\n }, response.data.expires_at ? { expiresAt: response.data.expires_at } : {});\n return { ...response, authentication };\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport btoa from \"btoa-lite\";\nexport async function resetToken(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const auth = btoa(`${options.clientId}:${options.clientSecret}`);\n const response = await request(\"PATCH /applications/{client_id}/token\", {\n headers: {\n authorization: `basic ${auth}`,\n },\n client_id: options.clientId,\n access_token: options.token,\n });\n const authentication = {\n clientType: options.clientType,\n clientId: options.clientId,\n clientSecret: options.clientSecret,\n token: response.data.token,\n scopes: response.data.scopes,\n };\n if (response.data.expires_at)\n authentication.expiresAt = response.data.expires_at;\n if (options.clientType === \"github-app\") {\n delete authentication.scopes;\n }\n return { ...response, authentication };\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport btoa from \"btoa-lite\";\nexport async function deleteToken(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const auth = btoa(`${options.clientId}:${options.clientSecret}`);\n return request(\"DELETE /applications/{client_id}/token\", {\n headers: {\n authorization: `basic ${auth}`,\n },\n client_id: options.clientId,\n access_token: options.token,\n });\n}\n","import { request as defaultRequest } from \"@octokit/request\";\nimport btoa from \"btoa-lite\";\nexport async function deleteAuthorization(options) {\n const request = options.request ||\n /* istanbul ignore next: we always pass a custom request in tests */\n defaultRequest;\n const auth = btoa(`${options.clientId}:${options.clientSecret}`);\n return request(\"DELETE /applications/{client_id}/grant\", {\n headers: {\n authorization: `basic ${auth}`,\n },\n client_id: options.clientId,\n access_token: options.token,\n });\n}\n"],"names":["VERSION","requestToOAuthBaseUrl","request","endpointDefaults","endpoint","DEFAULTS","test","baseUrl","replace","oauthRequest","route","parameters","withOAuthParameters","headers","accept","response","data","error","RequestError","error_description","error_uri","merge","getWebFlowAuthorizationUrl","defaultRequest","options","oauthAuthorizationUrl","exchangeWebFlowCode","client_id","clientId","client_secret","clientSecret","code","redirect_uri","redirectUrl","authentication","clientType","token","access_token","scopes","scope","split","filter","Boolean","apiTimeInMs","Date","date","getTime","refreshToken","refresh_token","expiresAt","toTimestamp","expires_in","refreshTokenExpiresAt","refresh_token_expires_in","expirationInSeconds","toISOString","createDeviceCode","Array","isArray","join","exchangeDeviceCode","device_code","grant_type","checkToken","authorization","btoa","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jB;AACA,SAAO5B,SAAO,CAAC,wCAAD,EAA2C;AACrDW,IAAAA,OAAO,EAAE;AACLmD,MAAAA,aAAa,EAAG,SAAQQ,IAAK;AADxB,KAD4C;AAIrD7C,IAAAA,SAAS,EAAEH,OAAO,CAACI,QAJkC;AAKrDS,IAAAA,YAAY,EAAEb,OAAO,CAACY;AAL+B,GAA3C,CAAd;AAOH;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/oauth-methods/dist-src/check-token.js b/node_modules/@octokit/oauth-methods/dist-src/check-token.js
new file mode 100644
index 0000000..1f65e94
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/check-token.js
@@ -0,0 +1,27 @@
+import { request as defaultRequest } from "@octokit/request";
+import btoa from "btoa-lite";
+export async function checkToken(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const response = await request("POST /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${btoa(`${options.clientId}:${options.clientSecret}`)}`,
+ },
+ client_id: options.clientId,
+ access_token: options.token,
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: options.token,
+ scopes: response.data.scopes,
+ };
+ if (response.data.expires_at)
+ authentication.expiresAt = response.data.expires_at;
+ if (options.clientType === "github-app") {
+ delete authentication.scopes;
+ }
+ return { ...response, authentication };
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/create-device-code.js b/node_modules/@octokit/oauth-methods/dist-src/create-device-code.js
new file mode 100644
index 0000000..bdb3b3d
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/create-device-code.js
@@ -0,0 +1,14 @@
+import { request as defaultRequest } from "@octokit/request";
+import { oauthRequest } from "./utils";
+export async function createDeviceCode(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const parameters = {
+ client_id: options.clientId,
+ };
+ if ("scopes" in options && Array.isArray(options.scopes)) {
+ parameters.scope = options.scopes.join(" ");
+ }
+ return oauthRequest(request, "POST /login/device/code", parameters);
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/delete-authorization.js b/node_modules/@octokit/oauth-methods/dist-src/delete-authorization.js
new file mode 100644
index 0000000..ab5ce7d
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/delete-authorization.js
@@ -0,0 +1,15 @@
+import { request as defaultRequest } from "@octokit/request";
+import btoa from "btoa-lite";
+export async function deleteAuthorization(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ return request("DELETE /applications/{client_id}/grant", {
+ headers: {
+ authorization: `basic ${auth}`,
+ },
+ client_id: options.clientId,
+ access_token: options.token,
+ });
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/delete-token.js b/node_modules/@octokit/oauth-methods/dist-src/delete-token.js
new file mode 100644
index 0000000..e94ccb9
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/delete-token.js
@@ -0,0 +1,15 @@
+import { request as defaultRequest } from "@octokit/request";
+import btoa from "btoa-lite";
+export async function deleteToken(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ return request("DELETE /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${auth}`,
+ },
+ client_id: options.clientId,
+ access_token: options.token,
+ });
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/exchange-device-code.js b/node_modules/@octokit/oauth-methods/dist-src/exchange-device-code.js
new file mode 100644
index 0000000..8e54319
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/exchange-device-code.js
@@ -0,0 +1,34 @@
+import { request as defaultRequest } from "@octokit/request";
+import { oauthRequest } from "./utils";
+export async function exchangeDeviceCode(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const response = await oauthRequest(request, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ device_code: options.code,
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code",
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ token: response.data.access_token,
+ scopes: response.data.scope.split(/\s+/).filter(Boolean),
+ };
+ if ("clientSecret" in options) {
+ authentication.clientSecret = options.clientSecret;
+ }
+ if (options.clientType === "github-app") {
+ if ("refresh_token" in response.data) {
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ (authentication.refreshToken = response.data.refresh_token),
+ (authentication.expiresAt = toTimestamp(apiTimeInMs, response.data.expires_in)),
+ (authentication.refreshTokenExpiresAt = toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in));
+ }
+ delete authentication.scopes;
+ }
+ return { ...response, authentication };
+}
+function toTimestamp(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/exchange-web-flow-code.js b/node_modules/@octokit/oauth-methods/dist-src/exchange-web-flow-code.js
new file mode 100644
index 0000000..412ad0f
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/exchange-web-flow-code.js
@@ -0,0 +1,33 @@
+import { request as defaultRequest } from "@octokit/request";
+import { oauthRequest } from "./utils";
+export async function exchangeWebFlowCode(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const response = await oauthRequest(request, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ client_secret: options.clientSecret,
+ code: options.code,
+ redirect_uri: options.redirectUrl,
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.access_token,
+ scopes: response.data.scope.split(/\s+/).filter(Boolean),
+ };
+ if (options.clientType === "github-app") {
+ if ("refresh_token" in response.data) {
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ (authentication.refreshToken = response.data.refresh_token),
+ (authentication.expiresAt = toTimestamp(apiTimeInMs, response.data.expires_in)),
+ (authentication.refreshTokenExpiresAt = toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in));
+ }
+ delete authentication.scopes;
+ }
+ return { ...response, authentication };
+}
+function toTimestamp(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/get-web-flow-authorization-url.js b/node_modules/@octokit/oauth-methods/dist-src/get-web-flow-authorization-url.js
new file mode 100644
index 0000000..e742964
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/get-web-flow-authorization-url.js
@@ -0,0 +1,11 @@
+import { oauthAuthorizationUrl, } from "@octokit/oauth-authorization-url";
+import { request as defaultRequest } from "@octokit/request";
+import { requestToOAuthBaseUrl } from "./utils";
+export function getWebFlowAuthorizationUrl({ request = defaultRequest, ...options }) {
+ const baseUrl = requestToOAuthBaseUrl(request);
+ // @ts-expect-error TypeScript wants `clientType` to be set explicitly ¯\_(ツ)_/¯
+ return oauthAuthorizationUrl({
+ ...options,
+ baseUrl,
+ });
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/index.js b/node_modules/@octokit/oauth-methods/dist-src/index.js
new file mode 100644
index 0000000..1337e19
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/index.js
@@ -0,0 +1,11 @@
+export { VERSION } from "./version";
+export * from "./get-web-flow-authorization-url";
+export * from "./exchange-web-flow-code";
+export * from "./create-device-code";
+export * from "./exchange-device-code";
+export * from "./check-token";
+export * from "./refresh-token";
+export * from "./scope-token";
+export * from "./reset-token";
+export * from "./delete-token";
+export * from "./delete-authorization";
diff --git a/node_modules/@octokit/oauth-methods/dist-src/refresh-token.js b/node_modules/@octokit/oauth-methods/dist-src/refresh-token.js
new file mode 100644
index 0000000..0ce9bf8
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/refresh-token.js
@@ -0,0 +1,27 @@
+import { request as defaultRequest } from "@octokit/request";
+import { oauthRequest } from "./utils";
+export async function refreshToken(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const response = await oauthRequest(request, "POST /login/oauth/access_token", {
+ client_id: options.clientId,
+ client_secret: options.clientSecret,
+ grant_type: "refresh_token",
+ refresh_token: options.refreshToken,
+ });
+ const apiTimeInMs = new Date(response.headers.date).getTime();
+ const authentication = {
+ clientType: "github-app",
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.access_token,
+ refreshToken: response.data.refresh_token,
+ expiresAt: toTimestamp(apiTimeInMs, response.data.expires_in),
+ refreshTokenExpiresAt: toTimestamp(apiTimeInMs, response.data.refresh_token_expires_in),
+ };
+ return { ...response, authentication };
+}
+function toTimestamp(apiTimeInMs, expirationInSeconds) {
+ return new Date(apiTimeInMs + expirationInSeconds * 1000).toISOString();
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/reset-token.js b/node_modules/@octokit/oauth-methods/dist-src/reset-token.js
new file mode 100644
index 0000000..3e87a10
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/reset-token.js
@@ -0,0 +1,28 @@
+import { request as defaultRequest } from "@octokit/request";
+import btoa from "btoa-lite";
+export async function resetToken(options) {
+ const request = options.request ||
+ /* istanbul ignore next: we always pass a custom request in tests */
+ defaultRequest;
+ const auth = btoa(`${options.clientId}:${options.clientSecret}`);
+ const response = await request("PATCH /applications/{client_id}/token", {
+ headers: {
+ authorization: `basic ${auth}`,
+ },
+ client_id: options.clientId,
+ access_token: options.token,
+ });
+ const authentication = {
+ clientType: options.clientType,
+ clientId: options.clientId,
+ clientSecret: options.clientSecret,
+ token: response.data.token,
+ scopes: response.data.scopes,
+ };
+ if (response.data.expires_at)
+ authentication.expiresAt = response.data.expires_at;
+ if (options.clientType === "github-app") {
+ delete authentication.scopes;
+ }
+ return { ...response, authentication };
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/scope-token.js b/node_modules/@octokit/oauth-methods/dist-src/scope-token.js
new file mode 100644
index 0000000..e14bbf5
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/scope-token.js
@@ -0,0 +1,21 @@
+import { request as defaultRequest } from "@octokit/request";
+import btoa from "btoa-lite";
+export async function scopeToken(options) {
+ const { request, clientType, clientId, clientSecret, token, ...requestOptions } = options;
+ const response = await (request ||
+ /* istanbul ignore next: we always pass a custom request in tests */ defaultRequest)("POST /applications/{client_id}/token/scoped", {
+ headers: {
+ authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`,
+ },
+ client_id: clientId,
+ access_token: token,
+ ...requestOptions,
+ });
+ const authentication = Object.assign({
+ clientType,
+ clientId,
+ clientSecret,
+ token: response.data.token,
+ }, response.data.expires_at ? { expiresAt: response.data.expires_at } : {});
+ return { ...response, authentication };
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/types.js b/node_modules/@octokit/oauth-methods/dist-src/types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@octokit/oauth-methods/dist-src/utils.js b/node_modules/@octokit/oauth-methods/dist-src/utils.js
new file mode 100644
index 0000000..a2540b0
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/utils.js
@@ -0,0 +1,27 @@
+import { RequestError } from "@octokit/request-error";
+export function requestToOAuthBaseUrl(request) {
+ const endpointDefaults = request.endpoint.DEFAULTS;
+ return /^https:\/\/(api\.)?github\.com$/.test(endpointDefaults.baseUrl)
+ ? "https://github.com"
+ : endpointDefaults.baseUrl.replace("/api/v3", "");
+}
+export async function oauthRequest(request, route, parameters) {
+ const withOAuthParameters = {
+ baseUrl: requestToOAuthBaseUrl(request),
+ headers: {
+ accept: "application/json",
+ },
+ ...parameters,
+ };
+ const response = await request(route, withOAuthParameters);
+ if ("error" in response.data) {
+ const error = new RequestError(`${response.data.error_description} (${response.data.error}, ${response.data.error_uri})`, 400, {
+ request: request.endpoint.merge(route, withOAuthParameters),
+ headers: response.headers,
+ });
+ // @ts-ignore add custom response property until https://github.com/octokit/request-error.js/issues/169 is resolved
+ error.response = response;
+ throw error;
+ }
+ return response;
+}
diff --git a/node_modules/@octokit/oauth-methods/dist-src/version.js b/node_modules/@octokit/oauth-methods/dist-src/version.js
new file mode 100644
index 0000000..3f50c75
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "1.2.6";
diff --git a/node_modules/@octokit/oauth-methods/dist-types/check-token.d.ts b/node_modules/@octokit/oauth-methods/dist-types/check-token.d.ts
new file mode 100644
index 0000000..234ec3c
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/check-token.d.ts
@@ -0,0 +1,24 @@
+import { RequestInterface, Endpoints } from "@octokit/types";
+import { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled } from "./types";
+export declare type CheckTokenOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type CheckTokenGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type CheckTokenOAuthAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & {
+ authentication: OAuthAppAuthentication;
+};
+export declare type CheckTokenGitHubAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & {
+ authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled;
+};
+export declare function checkToken(options: CheckTokenOAuthAppOptions): Promise;
+export declare function checkToken(options: CheckTokenGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/create-device-code.d.ts b/node_modules/@octokit/oauth-methods/dist-types/create-device-code.d.ts
new file mode 100644
index 0000000..65c121e
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/create-device-code.d.ts
@@ -0,0 +1,20 @@
+import { OctokitResponse, RequestInterface } from "@octokit/types";
+export declare type CreateDeviceCodeOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ scopes?: string[];
+ request?: RequestInterface;
+};
+export declare type CreateDeviceCodeGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ request?: RequestInterface;
+};
+export declare type CreateDeviceCodeDeviceTokenResponse = OctokitResponse<{
+ device_code: string;
+ user_code: string;
+ verification_uri: string;
+ expires_in: number;
+ interval: number;
+}>;
+export declare function createDeviceCode(options: CreateDeviceCodeOAuthAppOptions | CreateDeviceCodeGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/delete-authorization.d.ts b/node_modules/@octokit/oauth-methods/dist-types/delete-authorization.d.ts
new file mode 100644
index 0000000..fee77d1
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/delete-authorization.d.ts
@@ -0,0 +1,18 @@
+import { RequestInterface, Endpoints } from "@octokit/types";
+export declare type DeleteAuthorizationOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type DeleteAuthorizationGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type DeleteAuthorizationResponse = Endpoints["DELETE /applications/{client_id}/grant"]["response"];
+export declare function deleteAuthorization(options: DeleteAuthorizationOAuthAppOptions): Promise;
+export declare function deleteAuthorization(options: DeleteAuthorizationGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/delete-token.d.ts b/node_modules/@octokit/oauth-methods/dist-types/delete-token.d.ts
new file mode 100644
index 0000000..d777357
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/delete-token.d.ts
@@ -0,0 +1,18 @@
+import { RequestInterface, Endpoints } from "@octokit/types";
+export declare type DeleteTokenOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type DeleteTokenGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type DeleteTokenResponse = Endpoints["DELETE /applications/{client_id}/token"]["response"];
+export declare function deleteToken(options: DeleteTokenOAuthAppOptions): Promise;
+export declare function deleteToken(options: DeleteTokenGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/exchange-device-code.d.ts b/node_modules/@octokit/oauth-methods/dist-types/exchange-device-code.d.ts
new file mode 100644
index 0000000..3528761
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/exchange-device-code.d.ts
@@ -0,0 +1,57 @@
+import { OctokitResponse, RequestInterface } from "@octokit/types";
+import { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled, GitHubAppAuthenticationWithRefreshToken, OAuthAppCreateTokenResponseData, GitHubAppCreateTokenResponseData, GitHubAppCreateTokenWithExpirationResponseData } from "./types";
+export declare type ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret = {
+ clientType: "oauth-app";
+ clientId: string;
+ code: string;
+ redirectUrl?: string;
+ state?: string;
+ request?: RequestInterface;
+ scopes?: string[];
+};
+export declare type ExchangeDeviceCodeOAuthAppOptions = ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret & {
+ clientSecret: string;
+};
+export declare type ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret = {
+ clientType: "github-app";
+ clientId: string;
+ code: string;
+ redirectUrl?: string;
+ state?: string;
+ request?: RequestInterface;
+};
+export declare type ExchangeDeviceCodeGitHubAppOptions = ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret & {
+ clientSecret: string;
+};
+declare type OAuthAppAuthenticationWithoutClientSecret = Omit;
+declare type GitHubAppAuthenticationWithoutClientSecret = Omit;
+declare type GitHubAppAuthenticationWithExpirationWithoutClientSecret = Omit;
+export declare type ExchangeDeviceCodeOAuthAppResponse = OctokitResponse & {
+ authentication: OAuthAppAuthentication;
+};
+export declare type ExchangeDeviceCodeOAuthAppResponseWithoutClientSecret = OctokitResponse & {
+ authentication: OAuthAppAuthenticationWithoutClientSecret;
+};
+export declare type ExchangeDeviceCodeGitHubAppResponse = OctokitResponse & {
+ authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled | GitHubAppAuthenticationWithRefreshToken;
+};
+export declare type ExchangeDeviceCodeGitHubAppResponseWithoutClientSecret = OctokitResponse & {
+ authentication: GitHubAppAuthenticationWithoutClientSecret | GitHubAppAuthenticationWithExpirationWithoutClientSecret;
+};
+/**
+ * Exchange the code from GitHub's OAuth Web flow for OAuth Apps.
+ */
+export declare function exchangeDeviceCode(options: ExchangeDeviceCodeOAuthAppOptions): Promise;
+/**
+ * Exchange the code from GitHub's OAuth Web flow for OAuth Apps without clientSecret
+ */
+export declare function exchangeDeviceCode(options: ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret): Promise;
+/**
+ * Exchange the code from GitHub's OAuth Web flow for GitHub Apps. `scopes` are not supported by GitHub Apps.
+ */
+export declare function exchangeDeviceCode(options: ExchangeDeviceCodeGitHubAppOptions): Promise;
+/**
+ * Exchange the code from GitHub's OAuth Web flow for GitHub Apps without using `clientSecret`. `scopes` are not supported by GitHub Apps.
+ */
+export declare function exchangeDeviceCode(options: ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret): Promise;
+export {};
diff --git a/node_modules/@octokit/oauth-methods/dist-types/exchange-web-flow-code.d.ts b/node_modules/@octokit/oauth-methods/dist-types/exchange-web-flow-code.d.ts
new file mode 100644
index 0000000..68b7c6d
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/exchange-web-flow-code.d.ts
@@ -0,0 +1,32 @@
+import { OctokitResponse, RequestInterface } from "@octokit/types";
+import { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled, GitHubAppAuthenticationWithRefreshToken, OAuthAppCreateTokenResponseData, GitHubAppCreateTokenResponseData, GitHubAppCreateTokenWithExpirationResponseData } from "./types";
+export declare type ExchangeWebFlowCodeOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ code: string;
+ redirectUrl?: string;
+ request?: RequestInterface;
+};
+export declare type ExchangeWebFlowCodeGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ code: string;
+ redirectUrl?: string;
+ request?: RequestInterface;
+};
+export declare type ExchangeWebFlowCodeOAuthAppResponse = OctokitResponse & {
+ authentication: OAuthAppAuthentication;
+};
+export declare type ExchangeWebFlowCodeGitHubAppResponse = OctokitResponse & {
+ authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled | GitHubAppAuthenticationWithRefreshToken;
+};
+/**
+ * Exchange the code from GitHub's OAuth Web flow for OAuth Apps.
+ */
+export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeOAuthAppOptions): Promise;
+/**
+ * Exchange the code from GitHub's OAuth Web flow for GitHub Apps. Note that `scopes` are not supported by GitHub Apps.
+ */
+export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/get-web-flow-authorization-url.d.ts b/node_modules/@octokit/oauth-methods/dist-types/get-web-flow-authorization-url.d.ts
new file mode 100644
index 0000000..c721600
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/get-web-flow-authorization-url.d.ts
@@ -0,0 +1,25 @@
+import { OAuthAppResult, GitHubAppResult } from "@octokit/oauth-authorization-url";
+import { RequestInterface } from "@octokit/types";
+export declare type GetWebFlowAuthorizationUrlOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ allowSignup?: boolean;
+ login?: string;
+ scopes?: string | string[];
+ redirectUrl?: string;
+ state?: string;
+ request?: RequestInterface;
+};
+export declare type GetWebFlowAuthorizationUrlGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ allowSignup?: boolean;
+ login?: string;
+ redirectUrl?: string;
+ state?: string;
+ request?: RequestInterface;
+};
+export declare type GetWebFlowAuthorizationUrlOAuthAppResult = OAuthAppResult;
+export declare type GetWebFlowAuthorizationUrlGitHubAppResult = GitHubAppResult;
+export declare function getWebFlowAuthorizationUrl(options: GetWebFlowAuthorizationUrlOAuthAppOptions): OAuthAppResult;
+export declare function getWebFlowAuthorizationUrl(options: GetWebFlowAuthorizationUrlGitHubAppOptions): GitHubAppResult;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/index.d.ts b/node_modules/@octokit/oauth-methods/dist-types/index.d.ts
new file mode 100644
index 0000000..0157ae2
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/index.d.ts
@@ -0,0 +1,12 @@
+export { VERSION } from "./version";
+export * from "./get-web-flow-authorization-url";
+export * from "./exchange-web-flow-code";
+export * from "./create-device-code";
+export * from "./exchange-device-code";
+export * from "./check-token";
+export * from "./refresh-token";
+export * from "./scope-token";
+export * from "./reset-token";
+export * from "./delete-token";
+export * from "./delete-authorization";
+export { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationDisabled, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithRefreshToken, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, } from "./types";
diff --git a/node_modules/@octokit/oauth-methods/dist-types/refresh-token.d.ts b/node_modules/@octokit/oauth-methods/dist-types/refresh-token.d.ts
new file mode 100644
index 0000000..246e4f3
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/refresh-token.d.ts
@@ -0,0 +1,13 @@
+import { OctokitResponse, RequestInterface } from "@octokit/types";
+import { GitHubAppAuthenticationWithRefreshToken, GitHubAppCreateTokenWithExpirationResponseData } from "./types";
+export declare type RefreshTokenOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ refreshToken: string;
+ request?: RequestInterface;
+};
+export declare type RefreshTokenResponse = OctokitResponse & {
+ authentication: GitHubAppAuthenticationWithRefreshToken;
+};
+export declare function refreshToken(options: RefreshTokenOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/reset-token.d.ts b/node_modules/@octokit/oauth-methods/dist-types/reset-token.d.ts
new file mode 100644
index 0000000..ca5402b
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/reset-token.d.ts
@@ -0,0 +1,24 @@
+import { RequestInterface, Endpoints } from "@octokit/types";
+import { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled } from "./types";
+export declare type ResetTokenOAuthAppOptions = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type ResetTokenGitHubAppOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ request?: RequestInterface;
+};
+export declare type ResetTokenOAuthAppResponse = Endpoints["PATCH /applications/{client_id}/token"]["response"] & {
+ authentication: OAuthAppAuthentication;
+};
+export declare type ResetTokenGitHubAppResponse = Endpoints["PATCH /applications/{client_id}/token"]["response"] & {
+ authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled;
+};
+export declare function resetToken(options: ResetTokenOAuthAppOptions): Promise;
+export declare function resetToken(options: ResetTokenGitHubAppOptions): Promise;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/scope-token.d.ts b/node_modules/@octokit/oauth-methods/dist-types/scope-token.d.ts
new file mode 100644
index 0000000..d1cb95d
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/scope-token.d.ts
@@ -0,0 +1,29 @@
+import { RequestInterface, Endpoints } from "@octokit/types";
+import { GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled } from "./types";
+declare type CommonOptions = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ permissions?: Endpoint["parameters"]["permissions"];
+ request?: RequestInterface;
+};
+declare type TargetOption = {
+ target: string;
+};
+declare type TargetIdOption = {
+ target_id: number;
+};
+declare type RepositoriesOption = {
+ repositories?: string[];
+};
+declare type RepositoryIdsOption = {
+ repository_ids?: number[];
+};
+declare type Endpoint = Endpoints["POST /applications/{client_id}/token/scoped"];
+export declare type ScopeTokenOptions = (CommonOptions & TargetOption & RepositoriesOption) | (CommonOptions & TargetIdOption & RepositoriesOption) | (CommonOptions & TargetOption & RepositoryIdsOption) | (CommonOptions & TargetIdOption & RepositoryIdsOption);
+export declare type ScopeTokenResponse = Endpoint["response"] & {
+ authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled;
+};
+export declare function scopeToken(options: ScopeTokenOptions): Promise;
+export {};
diff --git a/node_modules/@octokit/oauth-methods/dist-types/types.d.ts b/node_modules/@octokit/oauth-methods/dist-types/types.d.ts
new file mode 100644
index 0000000..afeffee
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/types.d.ts
@@ -0,0 +1,58 @@
+export declare type OAuthAppAuthentication = {
+ clientType: "oauth-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ scopes: string[];
+};
+export declare type GitHubAppAuthenticationWithExpirationDisabled = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+};
+export declare type GitHubAppAuthenticationWithExpirationEnabled = GitHubAppAuthenticationWithExpirationDisabled & {
+ expiresAt: string;
+};
+export declare type GitHubAppAuthenticationWithRefreshToken = GitHubAppAuthenticationWithExpirationEnabled & {
+ refreshToken: string;
+ refreshTokenExpiresAt: string;
+};
+/**
+ * @deprecated Use `GitHubAppAuthenticationWithExpirationDisabled` or
+ * `GitHubAppAuthenticationWithExpirationEnabled` instead.
+ */
+export declare type GitHubAppAuthentication = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+};
+/**
+ * @deprecated Use `GitHubAppAuthenticationWithRefreshToken` instead.
+ */
+export declare type GitHubAppAuthenticationWithExpiration = {
+ clientType: "github-app";
+ clientId: string;
+ clientSecret: string;
+ token: string;
+ refreshToken: string;
+ expiresAt: string;
+ refreshTokenExpiresAt: string;
+};
+export declare type OAuthAppCreateTokenResponseData = {
+ access_token: string;
+ scope: string;
+ token_type: "bearer";
+};
+export declare type GitHubAppCreateTokenResponseData = {
+ access_token: string;
+ token_type: "bearer";
+};
+export declare type GitHubAppCreateTokenWithExpirationResponseData = {
+ access_token: string;
+ token_type: "bearer";
+ expires_in: number;
+ refresh_token: string;
+ refresh_token_expires_in: number;
+};
diff --git a/node_modules/@octokit/oauth-methods/dist-types/utils.d.ts b/node_modules/@octokit/oauth-methods/dist-types/utils.d.ts
new file mode 100644
index 0000000..ac692f5
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/utils.d.ts
@@ -0,0 +1,3 @@
+import { RequestInterface } from "@octokit/types";
+export declare function requestToOAuthBaseUrl(request: RequestInterface): string;
+export declare function oauthRequest(request: RequestInterface, route: string, parameters: Record): Promise>;
diff --git a/node_modules/@octokit/oauth-methods/dist-types/version.d.ts b/node_modules/@octokit/oauth-methods/dist-types/version.d.ts
new file mode 100644
index 0000000..16fa93d
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "1.2.6";
diff --git a/node_modules/@octokit/oauth-methods/package.json b/node_modules/@octokit/oauth-methods/package.json
new file mode 100644
index 0000000..9670b41
--- /dev/null
+++ b/node_modules/@octokit/oauth-methods/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "@octokit/oauth-methods",
+ "description": "Set of stateless request methods to create, check, reset, refresh, and delete user access tokens for OAuth and GitHub Apps",
+ "version": "1.2.6",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "api",
+ "sdk",
+ "toolkit",
+ "oauth"
+ ],
+ "repository": "https://github.com/octokit/oauth-methods.js",
+ "dependencies": {
+ "@octokit/oauth-authorization-url": "^4.3.1",
+ "@octokit/request": "^5.4.14",
+ "@octokit/request-error": "^2.0.5",
+ "@octokit/types": "^6.12.2",
+ "btoa-lite": "^1.0.0"
+ },
+ "peerDependencies": {},
+ "devDependencies": {
+ "@octokit/tsconfig": "^1.0.2",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.2",
+ "@pika/plugin-ts-standard-pkg": "^0.9.2",
+ "@types/btoa-lite": "^1.0.0",
+ "@types/jest": "^27.0.0",
+ "@types/node": "^14.14.35",
+ "fetch-mock": "^9.11.0",
+ "jest": "^27.0.0",
+ "prettier": "2.4.1",
+ "semantic-release": "^18.0.0",
+ "semantic-release-plugin-update-version-in-files": "^1.1.0",
+ "ts-jest": "^27.0.0-next.12",
+ "typescript": "^4.2.3"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js"
+}
diff --git a/node_modules/@octokit/plugin-request-log/LICENSE b/node_modules/@octokit/plugin-request-log/LICENSE
new file mode 100644
index 0000000..d7d5927
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/LICENSE
@@ -0,0 +1,7 @@
+MIT License Copyright (c) 2020 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@octokit/plugin-request-log/README.md b/node_modules/@octokit/plugin-request-log/README.md
new file mode 100644
index 0000000..cbc8f1b
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/README.md
@@ -0,0 +1,69 @@
+# plugin-request-log.js
+
+> Log all requests and request errors
+
+[![@latest](https://img.shields.io/npm/v/@octokit/plugin-request-log.svg)](https://www.npmjs.com/package/@octokit/plugin-request-log)
+[![Build Status](https://github.com/octokit/plugin-request-log.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-request-log.js/actions?workflow=Test)
+
+## Usage
+
+
+
+
+Browsers
+ |
+
+Load `@octokit/plugin-request-log` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
+
+```html
+
+```
+
+ |
+
+Node
+ |
+
+Install with `npm install @octokit/core @octokit/plugin-request-log`. Optionally replace `@octokit/core` with a core-compatible module
+
+```js
+const { Octokit } = require("@octokit/core");
+const { requestLog } = require("@octokit/plugin-request-log");
+```
+
+ |
+
+
+
+```js
+const MyOctokit = Octokit.plugin(requestLog);
+const octokit = new MyOctokit({ auth: "secret123" });
+
+octokit.request("GET /");
+// logs "GET / - 200 in 123ms
+
+octokit.request("GET /oops");
+// logs "GET / - 404 in 123ms
+```
+
+In order to log all request options, the `log.debug` option needs to be set. We recommend the [console-log-level](https://github.com/watson/console-log-level) package for a configurable log level
+
+```js
+const octokit = new MyOctokit({
+ log: require("console-log-level")({
+ auth: "secret123",
+ level: "info",
+ }),
+});
+```
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md)
+
+## License
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/plugin-request-log/dist-node/index.js b/node_modules/@octokit/plugin-request-log/dist-node/index.js
new file mode 100644
index 0000000..acb457f
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-node/index.js
@@ -0,0 +1,30 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+const VERSION = "1.0.4";
+
+/**
+ * @param octokit Octokit instance
+ * @param options Options passed to Octokit constructor
+ */
+
+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
diff --git a/node_modules/@octokit/plugin-request-log/dist-node/index.js.map b/node_modules/@octokit/plugin-request-log/dist-node/index.js.map
new file mode 100644
index 0000000..e403f1a
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"1.0.4\";\n","import { VERSION } from \"./version\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function requestLog(octokit) {\n octokit.hook.wrap(\"request\", (request, options) => {\n octokit.log.debug(\"request\", options);\n const start = Date.now();\n const requestOptions = octokit.request.endpoint.parse(options);\n const path = requestOptions.url.replace(options.baseUrl, \"\");\n return request(options)\n .then((response) => {\n octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);\n return response;\n })\n .catch((error) => {\n octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);\n throw error;\n });\n });\n}\nrequestLog.VERSION = VERSION;\n"],"names":["VERSION","requestLog","octokit","hook","wrap","request","options","log","debug","start","Date","now","requestOptions","endpoint","parse","path","url","replace","baseUrl","then","response","info","method","status","catch","error"],"mappings":";;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACCP;AACA;AACA;AACA;;AACA,AAAO,SAASC,UAAT,CAAoBC,OAApB,EAA6B;AAChCA,EAAAA,OAAO,CAACC,IAAR,CAAaC,IAAb,CAAkB,SAAlB,EAA6B,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC/CJ,IAAAA,OAAO,CAACK,GAAR,CAAYC,KAAZ,CAAkB,SAAlB,EAA6BF,OAA7B;AACA,UAAMG,KAAK,GAAGC,IAAI,CAACC,GAAL,EAAd;AACA,UAAMC,cAAc,GAAGV,OAAO,CAACG,OAAR,CAAgBQ,QAAhB,CAAyBC,KAAzB,CAA+BR,OAA/B,CAAvB;AACA,UAAMS,IAAI,GAAGH,cAAc,CAACI,GAAf,CAAmBC,OAAnB,CAA2BX,OAAO,CAACY,OAAnC,EAA4C,EAA5C,CAAb;AACA,WAAOb,OAAO,CAACC,OAAD,CAAP,CACFa,IADE,CACIC,QAAD,IAAc;AACpBlB,MAAAA,OAAO,CAACK,GAAR,CAAYc,IAAZ,CAAkB,GAAET,cAAc,CAACU,MAAO,IAAGP,IAAK,MAAKK,QAAQ,CAACG,MAAO,OAAMb,IAAI,CAACC,GAAL,KAAaF,KAAM,IAAhG;AACA,aAAOW,QAAP;AACH,KAJM,EAKFI,KALE,CAKKC,KAAD,IAAW;AAClBvB,MAAAA,OAAO,CAACK,GAAR,CAAYc,IAAZ,CAAkB,GAAET,cAAc,CAACU,MAAO,IAAGP,IAAK,MAAKU,KAAK,CAACF,MAAO,OAAMb,IAAI,CAACC,GAAL,KAAaF,KAAM,IAA7F;AACA,YAAMgB,KAAN;AACH,KARM,CAAP;AASH,GAdD;AAeH;AACDxB,UAAU,CAACD,OAAX,GAAqBA,OAArB;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/plugin-request-log/dist-src/index.js b/node_modules/@octokit/plugin-request-log/dist-src/index.js
new file mode 100644
index 0000000..033cc84
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-src/index.js
@@ -0,0 +1,23 @@
+import { VERSION } from "./version";
+/**
+ * @param octokit Octokit instance
+ * @param options Options passed to Octokit constructor
+ */
+export 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;
diff --git a/node_modules/@octokit/plugin-request-log/dist-src/version.js b/node_modules/@octokit/plugin-request-log/dist-src/version.js
new file mode 100644
index 0000000..0e972ed
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "1.0.4";
diff --git a/node_modules/@octokit/plugin-request-log/dist-types/index.d.ts b/node_modules/@octokit/plugin-request-log/dist-types/index.d.ts
new file mode 100644
index 0000000..dc62f63
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-types/index.d.ts
@@ -0,0 +1,9 @@
+import type { Octokit } from "@octokit/core";
+/**
+ * @param octokit Octokit instance
+ * @param options Options passed to Octokit constructor
+ */
+export declare function requestLog(octokit: Octokit): void;
+export declare namespace requestLog {
+ var VERSION: string;
+}
diff --git a/node_modules/@octokit/plugin-request-log/dist-types/version.d.ts b/node_modules/@octokit/plugin-request-log/dist-types/version.d.ts
new file mode 100644
index 0000000..43d0a4b
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "1.0.4";
diff --git a/node_modules/@octokit/plugin-request-log/dist-web/index.js b/node_modules/@octokit/plugin-request-log/dist-web/index.js
new file mode 100644
index 0000000..3c1aaaf
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-web/index.js
@@ -0,0 +1,27 @@
+const VERSION = "1.0.4";
+
+/**
+ * @param octokit Octokit instance
+ * @param options Options passed to Octokit constructor
+ */
+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;
+
+export { requestLog };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/plugin-request-log/dist-web/index.js.map b/node_modules/@octokit/plugin-request-log/dist-web/index.js.map
new file mode 100644
index 0000000..4f1054c
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"1.0.4\";\n","import { VERSION } from \"./version\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function requestLog(octokit) {\n octokit.hook.wrap(\"request\", (request, options) => {\n octokit.log.debug(\"request\", options);\n const start = Date.now();\n const requestOptions = octokit.request.endpoint.parse(options);\n const path = requestOptions.url.replace(options.baseUrl, \"\");\n return request(options)\n .then((response) => {\n octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);\n return response;\n })\n .catch((error) => {\n octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);\n throw error;\n });\n });\n}\nrequestLog.VERSION = VERSION;\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACC1C;AACA;AACA;AACA;AACA,AAAO,SAAS,UAAU,CAAC,OAAO,EAAE;AACpC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK;AACvD,QAAQ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9C,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACjC,QAAQ,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvE,QAAQ,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACrE,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC;AAC/B,aAAa,IAAI,CAAC,CAAC,QAAQ,KAAK;AAChC,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AACjH,YAAY,OAAO,QAAQ,CAAC;AAC5B,SAAS,CAAC;AACV,aAAa,KAAK,CAAC,CAAC,KAAK,KAAK;AAC9B,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9G,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP,CAAC;AACD,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/plugin-request-log/package.json b/node_modules/@octokit/plugin-request-log/package.json
new file mode 100644
index 0000000..22c1c8f
--- /dev/null
+++ b/node_modules/@octokit/plugin-request-log/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "@octokit/plugin-request-log",
+ "description": "Log all requests and request errors",
+ "version": "1.0.4",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "github",
+ "api",
+ "sdk",
+ "toolkit"
+ ],
+ "repository": "github:octokit/plugin-request-log.js",
+ "dependencies": {},
+ "peerDependencies": {
+ "@octokit/core": ">=3"
+ },
+ "devDependencies": {
+ "@octokit/core": "^3.0.0",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.0",
+ "@pika/plugin-build-web": "^0.9.0",
+ "@pika/plugin-ts-standard-pkg": "^0.9.0",
+ "@types/fetch-mock": "^7.3.2",
+ "@types/jest": "^26.0.0",
+ "@types/node": "^14.0.4",
+ "fetch-mock": "^9.0.0",
+ "jest": "^27.0.0",
+ "prettier": "2.3.1",
+ "semantic-release": "^17.0.0",
+ "semantic-release-plugin-update-version-in-files": "^1.0.0",
+ "ts-jest": "^27.0.0-next.12",
+ "typescript": "^4.0.0"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@octokit/rest/LICENSE b/node_modules/@octokit/rest/LICENSE
new file mode 100644
index 0000000..4c0d268
--- /dev/null
+++ b/node_modules/@octokit/rest/LICENSE
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer)
+Copyright (c) 2017-2018 Octokit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@octokit/rest/README.md b/node_modules/@octokit/rest/README.md
new file mode 100644
index 0000000..cc320e1
--- /dev/null
+++ b/node_modules/@octokit/rest/README.md
@@ -0,0 +1,67 @@
+# rest.js
+
+> GitHub REST API client for JavaScript
+
+[![@latest](https://img.shields.io/npm/v/@octokit/rest.svg)](https://www.npmjs.com/package/@octokit/rest)
+[![Build Status](https://github.com/octokit/rest.js/workflows/Test/badge.svg)](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amaster)
+
+## Usage
+
+
+
+
+Browsers
+ |
+Load @octokit/rest directly from cdn.skypack.dev
+
+```html
+
+```
+
+ |
+
+Node
+ |
+
+Install with npm install @octokit/rest
+
+```js
+const { Octokit } = require("@octokit/rest");
+// or: import { Octokit } from "@octokit/rest";
+```
+
+ |
+
+
+
+```js
+const octokit = new Octokit();
+
+// Compare: https://docs.github.com/en/rest/reference/repos/#list-organization-repositories
+octokit.rest.repos
+ .listForOrg({
+ org: "octokit",
+ type: "public",
+ })
+ .then(({ data }) => {
+ // handle data
+ });
+```
+
+See https://octokit.github.io/rest.js for full documentation.
+
+## Contributing
+
+We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
+
+## Credits
+
+`@octokit/rest` was originally created as [`node-github`](https://www.npmjs.com/package/github) in 2012 by Mike de Boer from Cloud9 IDE, Inc. [The original commit](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/) is from 2010 which predates the npm registry.
+
+It was adopted and renamed by GitHub in 2017. Learn more about it's origin on GitHub's blog: [From 48k lines of code to 10—the story of GitHub’s JavaScript SDK](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/)
+
+## LICENSE
+
+[MIT](LICENSE)
diff --git a/node_modules/@octokit/rest/dist-node/index.js b/node_modules/@octokit/rest/dist-node/index.js
new file mode 100644
index 0000000..eb7e013
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-node/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var core = require('@octokit/core');
+var pluginRequestLog = require('@octokit/plugin-request-log');
+var pluginPaginateRest = require('@octokit/plugin-paginate-rest');
+var pluginRestEndpointMethods = require('@octokit/plugin-rest-endpoint-methods');
+
+const VERSION = "18.12.0";
+
+const Octokit = core.Octokit.plugin(pluginRequestLog.requestLog, pluginRestEndpointMethods.legacyRestEndpointMethods, pluginPaginateRest.paginateRest).defaults({
+ userAgent: `octokit-rest.js/${VERSION}`
+});
+
+exports.Octokit = Octokit;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/rest/dist-node/index.js.map b/node_modules/@octokit/rest/dist-node/index.js.map
new file mode 100644
index 0000000..3997d55
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-node/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"18.12.0\";\n","import { Octokit as Core } from \"@octokit/core\";\nimport { requestLog } from \"@octokit/plugin-request-log\";\nimport { paginateRest } from \"@octokit/plugin-paginate-rest\";\nimport { legacyRestEndpointMethods } from \"@octokit/plugin-rest-endpoint-methods\";\nimport { VERSION } from \"./version\";\nexport const Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({\n userAgent: `octokit-rest.js/${VERSION}`,\n});\n"],"names":["VERSION","Octokit","Core","plugin","requestLog","legacyRestEndpointMethods","paginateRest","defaults","userAgent"],"mappings":";;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;MCKMC,OAAO,GAAGC,YAAI,CAACC,MAAL,CAAYC,2BAAZ,EAAwBC,mDAAxB,EAAmDC,+BAAnD,EAAiEC,QAAjE,CAA0E;AAC7FC,EAAAA,SAAS,EAAG,mBAAkBR,OAAQ;AADuD,CAA1E,CAAhB;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/rest/dist-src/index.js b/node_modules/@octokit/rest/dist-src/index.js
new file mode 100644
index 0000000..bba403b
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-src/index.js
@@ -0,0 +1,8 @@
+import { Octokit as Core } from "@octokit/core";
+import { requestLog } from "@octokit/plugin-request-log";
+import { paginateRest } from "@octokit/plugin-paginate-rest";
+import { legacyRestEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
+import { VERSION } from "./version";
+export const Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({
+ userAgent: `octokit-rest.js/${VERSION}`,
+});
diff --git a/node_modules/@octokit/rest/dist-src/version.js b/node_modules/@octokit/rest/dist-src/version.js
new file mode 100644
index 0000000..0ba878e
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-src/version.js
@@ -0,0 +1 @@
+export const VERSION = "18.12.0";
diff --git a/node_modules/@octokit/rest/dist-types/index.d.ts b/node_modules/@octokit/rest/dist-types/index.d.ts
new file mode 100644
index 0000000..a9c7de4
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-types/index.d.ts
@@ -0,0 +1,6 @@
+import { Octokit as Core } from "@octokit/core";
+export { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
+export declare const Octokit: typeof Core & import("@octokit/core/dist-types/types").Constructor<{
+ paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
+} & import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api>;
+export declare type Octokit = InstanceType;
diff --git a/node_modules/@octokit/rest/dist-types/version.d.ts b/node_modules/@octokit/rest/dist-types/version.d.ts
new file mode 100644
index 0000000..8b1aecf
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-types/version.d.ts
@@ -0,0 +1 @@
+export declare const VERSION = "18.12.0";
diff --git a/node_modules/@octokit/rest/dist-web/index.js b/node_modules/@octokit/rest/dist-web/index.js
new file mode 100644
index 0000000..5f868cb
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-web/index.js
@@ -0,0 +1,13 @@
+import { Octokit as Octokit$1 } from '@octokit/core';
+import { requestLog } from '@octokit/plugin-request-log';
+import { paginateRest } from '@octokit/plugin-paginate-rest';
+import { legacyRestEndpointMethods } from '@octokit/plugin-rest-endpoint-methods';
+
+const VERSION = "18.12.0";
+
+const Octokit = Octokit$1.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({
+ userAgent: `octokit-rest.js/${VERSION}`,
+});
+
+export { Octokit };
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@octokit/rest/dist-web/index.js.map b/node_modules/@octokit/rest/dist-web/index.js.map
new file mode 100644
index 0000000..7187be0
--- /dev/null
+++ b/node_modules/@octokit/rest/dist-web/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"18.12.0\";\n","import { Octokit as Core } from \"@octokit/core\";\nimport { requestLog } from \"@octokit/plugin-request-log\";\nimport { paginateRest } from \"@octokit/plugin-paginate-rest\";\nimport { legacyRestEndpointMethods } from \"@octokit/plugin-rest-endpoint-methods\";\nimport { VERSION } from \"./version\";\nexport const Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({\n userAgent: `octokit-rest.js/${VERSION}`,\n});\n"],"names":["Core"],"mappings":";;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACK9B,MAAC,OAAO,GAAGA,SAAI,CAAC,MAAM,CAAC,UAAU,EAAE,yBAAyB,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC;AACjG,IAAI,SAAS,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;;;;"}
\ No newline at end of file
diff --git a/node_modules/@octokit/rest/package.json b/node_modules/@octokit/rest/package.json
new file mode 100644
index 0000000..5042de1
--- /dev/null
+++ b/node_modules/@octokit/rest/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "@octokit/rest",
+ "description": "GitHub REST API client for Node.js",
+ "version": "18.12.0",
+ "license": "MIT",
+ "files": [
+ "dist-*/",
+ "bin/"
+ ],
+ "pika": true,
+ "sideEffects": false,
+ "keywords": [
+ "octokit",
+ "github",
+ "rest",
+ "api-client"
+ ],
+ "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": "github:octokit/rest.js",
+ "dependencies": {
+ "@octokit/core": "^3.5.1",
+ "@octokit/plugin-paginate-rest": "^2.16.8",
+ "@octokit/plugin-request-log": "^1.0.4",
+ "@octokit/plugin-rest-endpoint-methods": "^5.12.0"
+ },
+ "devDependencies": {
+ "@octokit/auth": "^3.0.3",
+ "@octokit/fixtures-server": "^7.0.0",
+ "@octokit/request": "^5.6.1",
+ "@pika/pack": "^0.5.0",
+ "@pika/plugin-build-node": "^0.9.2",
+ "@pika/plugin-build-web": "^0.9.2",
+ "@pika/plugin-ts-standard-pkg": "^0.9.2",
+ "@types/jest": "^27.0.0",
+ "@types/node": "^14.0.1",
+ "fetch-mock": "^9.0.0",
+ "jest": "^27.0.1",
+ "prettier": "2.4.1",
+ "semantic-release": "^18.0.0",
+ "semantic-release-plugin-update-version-in-files": "^1.0.0",
+ "ts-jest": "^27.0.1",
+ "typescript": "^4.0.0"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "source": "dist-src/index.js",
+ "types": "dist-types/index.d.ts",
+ "main": "dist-node/index.js",
+ "module": "dist-web/index.js"
+}
diff --git a/node_modules/@types/btoa-lite/LICENSE b/node_modules/@types/btoa-lite/LICENSE
new file mode 100644
index 0000000..2107107
--- /dev/null
+++ b/node_modules/@types/btoa-lite/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/btoa-lite/README.md b/node_modules/@types/btoa-lite/README.md
new file mode 100644
index 0000000..c028672
--- /dev/null
+++ b/node_modules/@types/btoa-lite/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/btoa-lite`
+
+# Summary
+This package contains type definitions for btoa-lite ( https://github.com/hughsk/btoa-lite ).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/btoa-lite
+
+Additional Details
+ * Last updated: Sat, 08 Jun 2019 01:29:52 GMT
+ * Dependencies: none
+ * Global values: none
+
+# Credits
+These definitions were written by Gregor Martynus .
diff --git a/node_modules/@types/btoa-lite/index.d.ts b/node_modules/@types/btoa-lite/index.d.ts
new file mode 100644
index 0000000..843b784
--- /dev/null
+++ b/node_modules/@types/btoa-lite/index.d.ts
@@ -0,0 +1,9 @@
+// Type definitions for btoa-lite 1.0
+// Project: https://github.com/hughsk/btoa-lite
+// Definitions by: Gregor Martynus
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+type EncodedData = string;
+declare function btoa(decodedData: string): EncodedData;
+
+export = btoa;
diff --git a/node_modules/@types/btoa-lite/package.json b/node_modules/@types/btoa-lite/package.json
new file mode 100644
index 0000000..7ea0a35
--- /dev/null
+++ b/node_modules/@types/btoa-lite/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "@types/btoa-lite",
+ "version": "1.0.0",
+ "description": "TypeScript definitions for btoa-lite",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Gregor Martynus",
+ "url": "https://github.com/gr2m",
+ "githubUsername": "gr2m"
+ }
+ ],
+ "main": "",
+ "types": "index",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/btoa-lite"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "62db71e6c7d4b0ec13f068b0e9d9dc9a80c2131a9703cace1abf225a479c7e84",
+ "typeScriptVersion": "2.0"
+}
\ No newline at end of file
diff --git a/node_modules/@types/jsonwebtoken/LICENSE b/node_modules/@types/jsonwebtoken/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/node_modules/@types/jsonwebtoken/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/jsonwebtoken/README.md b/node_modules/@types/jsonwebtoken/README.md
new file mode 100644
index 0000000..7f86dee
--- /dev/null
+++ b/node_modules/@types/jsonwebtoken/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/jsonwebtoken`
+
+# Summary
+This package contains type definitions for jsonwebtoken (https://github.com/auth0/node-jsonwebtoken).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonwebtoken.
+
+### Additional Details
+ * Last updated: Mon, 15 Nov 2021 17:31:56 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+ * Global values: none
+
+# Credits
+These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), [Daniel Heim](https://github.com/danielheim), [Brice BERNARD](https://github.com/brikou), [Veli-Pekka Kestilä](https://github.com/vpk), [Daniel Parker](https://github.com/GeneralistDev), [Kjell Dießel](https://github.com/kettil), [Robert Gajda](https://github.com/RunAge), [Nico Flaig](https://github.com/nflaig), [Linus Unnebäck](https://github.com/LinusU), [Ivan Sieder](https://github.com/ivansieder), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Nandor Kraszlan](https://github.com/nandi95).
diff --git a/node_modules/@types/jsonwebtoken/index.d.ts b/node_modules/@types/jsonwebtoken/index.d.ts
new file mode 100644
index 0000000..5a70541
--- /dev/null
+++ b/node_modules/@types/jsonwebtoken/index.d.ts
@@ -0,0 +1,239 @@
+// Type definitions for jsonwebtoken 8.5
+// Project: https://github.com/auth0/node-jsonwebtoken
+// Definitions by: Maxime LUCE ,
+// Daniel Heim ,
+// Brice BERNARD ,
+// Veli-Pekka Kestilä ,
+// Daniel Parker ,
+// Kjell Dießel ,
+// Robert Gajda ,
+// Nico Flaig ,
+// Linus Unnebäck
+// Ivan Sieder
+// Piotr Błażejewicz
+// Nandor Kraszlan
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+export class JsonWebTokenError extends Error {
+ inner: Error;
+
+ constructor(message: string, error?: Error);
+}
+
+export class TokenExpiredError extends JsonWebTokenError {
+ expiredAt: Date;
+
+ constructor(message: string, expiredAt: Date);
+}
+
+/**
+ * Thrown if current time is before the nbf claim.
+ */
+export class NotBeforeError extends JsonWebTokenError {
+ date: Date;
+
+ constructor(message: string, date: Date);
+}
+
+export interface SignOptions {
+ /**
+ * Signature algorithm. Could be one of these values :
+ * - HS256: HMAC using SHA-256 hash algorithm (default)
+ * - HS384: HMAC using SHA-384 hash algorithm
+ * - HS512: HMAC using SHA-512 hash algorithm
+ * - RS256: RSASSA using SHA-256 hash algorithm
+ * - RS384: RSASSA using SHA-384 hash algorithm
+ * - RS512: RSASSA using SHA-512 hash algorithm
+ * - ES256: ECDSA using P-256 curve and SHA-256 hash algorithm
+ * - ES384: ECDSA using P-384 curve and SHA-384 hash algorithm
+ * - ES512: ECDSA using P-521 curve and SHA-512 hash algorithm
+ * - none: No digital signature or MAC value included
+ */
+ algorithm?: Algorithm | undefined;
+ keyid?: string | undefined;
+ /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */
+ expiresIn?: string | number | undefined;
+ /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */
+ notBefore?: string | number | undefined;
+ audience?: string | string[] | undefined;
+ subject?: string | undefined;
+ issuer?: string | undefined;
+ jwtid?: string | undefined;
+ mutatePayload?: boolean | undefined;
+ noTimestamp?: boolean | undefined;
+ header?: JwtHeader | undefined;
+ encoding?: string | undefined;
+}
+
+export interface VerifyOptions {
+ algorithms?: Algorithm[] | undefined;
+ audience?: string | RegExp | Array | undefined;
+ clockTimestamp?: number | undefined;
+ clockTolerance?: number | undefined;
+ /** return an object with the decoded `{ payload, header, signature }` instead of only the usual content of the payload. */
+ complete?: boolean | undefined;
+ issuer?: string | string[] | undefined;
+ ignoreExpiration?: boolean | undefined;
+ ignoreNotBefore?: boolean | undefined;
+ jwtid?: string | undefined;
+ /**
+ * If you want to check `nonce` claim, provide a string value here.
+ * It is used on Open ID for the ID Tokens. ([Open ID implementation notes](https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes))
+ */
+ nonce?: string | undefined;
+ subject?: string | undefined;
+ maxAge?: string | number | undefined;
+}
+
+export interface DecodeOptions {
+ complete?: boolean | undefined;
+ json?: boolean | undefined;
+}
+export type VerifyErrors =
+ | JsonWebTokenError
+ | NotBeforeError
+ | TokenExpiredError;
+export type VerifyCallback = (
+ err: VerifyErrors | null,
+ decoded: T | undefined,
+) => void;
+
+export type SignCallback = (
+ err: Error | null, encoded: string | undefined
+) => void;
+
+// standard names https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1
+export interface JwtHeader {
+ alg: string | Algorithm;
+ typ?: string | undefined;
+ cty?: string | undefined;
+ crit?: Array> | undefined;
+ kid?: string | undefined;
+ jku?: string | undefined;
+ x5u?: string | string[] | undefined;
+ 'x5t#S256'?: string | undefined;
+ x5t?: string | undefined;
+ x5c?: string | string[] | undefined;
+}
+
+// standard claims https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
+export interface JwtPayload {
+ [key: string]: any;
+ iss?: string | undefined;
+ sub?: string | undefined;
+ aud?: string | string[] | undefined;
+ exp?: number | undefined;
+ nbf?: number | undefined;
+ iat?: number | undefined;
+ jti?: string | undefined;
+}
+
+export interface Jwt {
+ header: JwtHeader;
+ payload: JwtPayload;
+ signature: string;
+}
+
+// https://github.com/auth0/node-jsonwebtoken#algorithms-supported
+export type Algorithm =
+ "HS256" | "HS384" | "HS512" |
+ "RS256" | "RS384" | "RS512" |
+ "ES256" | "ES384" | "ES512" |
+ "PS256" | "PS384" | "PS512" |
+ "none";
+
+export type SigningKeyCallback = (
+ err: any,
+ signingKey?: Secret,
+) => void;
+
+export type GetPublicKeyOrSecret = (
+ header: JwtHeader,
+ callback: SigningKeyCallback
+) => void;
+
+export type Secret =
+ | string
+ | Buffer
+ | { key: string | Buffer; passphrase: string };
+
+/**
+ * Synchronously sign the given payload into a JSON Web Token string
+ * payload - Payload to sign, could be an literal, buffer or string
+ * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
+ * [options] - Options for the signature
+ * returns - The JSON Web Token string
+ */
+export function sign(
+ payload: string | Buffer | object,
+ secretOrPrivateKey: Secret,
+ options?: SignOptions,
+): string;
+
+/**
+ * Sign the given payload into a JSON Web Token string
+ * payload - Payload to sign, could be an literal, buffer or string
+ * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
+ * [options] - Options for the signature
+ * callback - Callback to get the encoded token on
+ */
+export function sign(
+ payload: string | Buffer | object,
+ secretOrPrivateKey: Secret,
+ callback: SignCallback,
+): void;
+export function sign(
+ payload: string | Buffer | object,
+ secretOrPrivateKey: Secret,
+ options: SignOptions,
+ callback: SignCallback,
+): void;
+
+/**
+ * Synchronously verify given token using a secret or a public key to get a decoded token
+ * token - JWT string to verify
+ * secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA.
+ * [options] - Options for the verification
+ * returns - The decoded token.
+ */
+export function verify(token: string, secretOrPublicKey: Secret, options: VerifyOptions & { complete: true }): Jwt | string;
+export function verify(token: string, secretOrPublicKey: Secret, options?: VerifyOptions): JwtPayload | string;
+
+/**
+ * Asynchronously verify given token using a secret or a public key to get a decoded token
+ * token - JWT string to verify
+ * secretOrPublicKey - A string or buffer containing either the secret for HMAC algorithms,
+ * or the PEM encoded public key for RSA and ECDSA. If jwt.verify is called asynchronous,
+ * secretOrPublicKey can be a function that should fetch the secret or public key
+ * [options] - Options for the verification
+ * callback - Callback to get the decoded token on
+ */
+export function verify(
+ token: string,
+ secretOrPublicKey: Secret | GetPublicKeyOrSecret,
+ callback?: VerifyCallback,
+): void;
+export function verify(
+ token: string,
+ secretOrPublicKey: Secret | GetPublicKeyOrSecret,
+ options?: VerifyOptions & { complete: true },
+ callback?: VerifyCallback,
+): void;
+export function verify(
+ token: string,
+ secretOrPublicKey: Secret | GetPublicKeyOrSecret,
+ options?: VerifyOptions,
+ callback?: VerifyCallback,
+): void;
+
+/**
+ * Returns the decoded payload without verifying if the signature is valid.
+ * token - JWT string to decode
+ * [options] - Options for decoding
+ * returns - The decoded Token
+ */
+export function decode(token: string, options: DecodeOptions & { complete: true }): null | Jwt;
+export function decode(token: string, options: DecodeOptions & { json: true }): null | JwtPayload;
+export function decode(token: string, options?: DecodeOptions): null | JwtPayload | string;
diff --git a/node_modules/@types/jsonwebtoken/package.json b/node_modules/@types/jsonwebtoken/package.json
new file mode 100644
index 0000000..096c5d1
--- /dev/null
+++ b/node_modules/@types/jsonwebtoken/package.json
@@ -0,0 +1,82 @@
+{
+ "name": "@types/jsonwebtoken",
+ "version": "8.5.6",
+ "description": "TypeScript definitions for jsonwebtoken",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonwebtoken",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Maxime LUCE",
+ "url": "https://github.com/SomaticIT",
+ "githubUsername": "SomaticIT"
+ },
+ {
+ "name": "Daniel Heim",
+ "url": "https://github.com/danielheim",
+ "githubUsername": "danielheim"
+ },
+ {
+ "name": "Brice BERNARD",
+ "url": "https://github.com/brikou",
+ "githubUsername": "brikou"
+ },
+ {
+ "name": "Veli-Pekka Kestilä",
+ "url": "https://github.com/vpk",
+ "githubUsername": "vpk"
+ },
+ {
+ "name": "Daniel Parker",
+ "url": "https://github.com/GeneralistDev",
+ "githubUsername": "GeneralistDev"
+ },
+ {
+ "name": "Kjell Dießel",
+ "url": "https://github.com/kettil",
+ "githubUsername": "kettil"
+ },
+ {
+ "name": "Robert Gajda",
+ "url": "https://github.com/RunAge",
+ "githubUsername": "RunAge"
+ },
+ {
+ "name": "Nico Flaig",
+ "url": "https://github.com/nflaig",
+ "githubUsername": "nflaig"
+ },
+ {
+ "name": "Linus Unnebäck",
+ "url": "https://github.com/LinusU",
+ "githubUsername": "LinusU"
+ },
+ {
+ "name": "Ivan Sieder",
+ "url": "https://github.com/ivansieder",
+ "githubUsername": "ivansieder"
+ },
+ {
+ "name": "Piotr Błażejewicz",
+ "url": "https://github.com/peterblazejewicz",
+ "githubUsername": "peterblazejewicz"
+ },
+ {
+ "name": "Nandor Kraszlan",
+ "url": "https://github.com/nandi95",
+ "githubUsername": "nandi95"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/jsonwebtoken"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "typesPublisherContentHash": "c533bfcb8060bf4a8fc924fc8a000af26bf78bad7026fc4038cb41a1be7ef887",
+ "typeScriptVersion": "3.7"
+}
\ No newline at end of file
diff --git a/node_modules/@types/lru-cache/LICENSE b/node_modules/@types/lru-cache/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/node_modules/@types/lru-cache/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/lru-cache/README.md b/node_modules/@types/lru-cache/README.md
new file mode 100644
index 0000000..7af91b7
--- /dev/null
+++ b/node_modules/@types/lru-cache/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/lru-cache`
+
+# Summary
+This package contains type definitions for lru-cache (https://github.com/isaacs/node-lru-cache).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lru-cache.
+
+### Additional Details
+ * Last updated: Tue, 06 Jul 2021 22:02:58 GMT
+ * Dependencies: none
+ * Global values: none
+
+# Credits
+These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), and [BendingBender](https://github.com/BendingBender).
diff --git a/node_modules/@types/lru-cache/index.d.ts b/node_modules/@types/lru-cache/index.d.ts
new file mode 100644
index 0000000..167b4c4
--- /dev/null
+++ b/node_modules/@types/lru-cache/index.d.ts
@@ -0,0 +1,193 @@
+// Type definitions for lru-cache 5.1
+// Project: https://github.com/isaacs/node-lru-cache
+// Definitions by: Bart van der Schoor
+// BendingBender
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+declare class LRUCache {
+ constructor(options?: LRUCache.Options);
+ constructor(max: number);
+
+ /**
+ * Return total length of objects in cache taking into account `length` options function.
+ */
+ readonly length: number;
+
+ /**
+ * Return total quantity of objects currently in cache. Note,
+ * that `stale` (see options) items are returned as part of this item count.
+ */
+ readonly itemCount: number;
+
+ /**
+ * Same as Options.allowStale.
+ */
+ allowStale: boolean;
+
+ /**
+ * Same as Options.length.
+ */
+ lengthCalculator(value: V): number;
+
+ /**
+ * Same as Options.max. Resizes the cache when the `max` changes.
+ */
+ max: number;
+
+ /**
+ * Same as Options.maxAge. Resizes the cache when the `maxAge` changes.
+ */
+ maxAge: number;
+
+ /**
+ * Will update the "recently used"-ness of the key. They do what you think.
+ * `maxAge` is optional and overrides the cache `maxAge` option if provided.
+ */
+ set(key: K, value: V, maxAge?: number): boolean;
+
+ /**
+ * Will update the "recently used"-ness of the key. They do what you think.
+ * `maxAge` is optional and overrides the cache `maxAge` option if provided.
+ *
+ * If the key is not found, will return `undefined`.
+ */
+ get(key: K): V | undefined;
+
+ /**
+ * Returns the key value (or `undefined` if not found) without updating
+ * the "recently used"-ness of the key.
+ *
+ * (If you find yourself using this a lot, you might be using the wrong
+ * sort of data structure, but there are some use cases where it's handy.)
+ */
+ peek(key: K): V | undefined;
+
+ /**
+ * Check if a key is in the cache, without updating the recent-ness
+ * or deleting it for being stale.
+ */
+ has(key: K): boolean;
+
+ /**
+ * Deletes a key out of the cache.
+ */
+ del(key: K): void;
+
+ /**
+ * Clear the cache entirely, throwing away all values.
+ */
+ reset(): void;
+
+ /**
+ * Manually iterates over the entire cache proactively pruning old entries.
+ */
+ prune(): void;
+
+ /**
+ * Just like `Array.prototype.forEach`. Iterates over all the keys in the cache,
+ * in order of recent-ness. (Ie, more recently used items are iterated over first.)
+ */
+ forEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
+
+ /**
+ * The same as `cache.forEach(...)` but items are iterated over in reverse order.
+ * (ie, less recently used items are iterated over first.)
+ */
+ rforEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
+
+ /**
+ * Return an array of the keys in the cache.
+ */
+ keys(): K[];
+
+ /**
+ * Return an array of the values in the cache.
+ */
+ values(): V[];
+
+ /**
+ * Return an array of the cache entries ready for serialization and usage with `destinationCache.load(arr)`.
+ */
+ dump(): Array>;
+
+ /**
+ * Loads another cache entries array, obtained with `sourceCache.dump()`,
+ * into the cache. The destination cache is reset before loading new entries
+ *
+ * @param cacheEntries Obtained from `sourceCache.dump()`
+ */
+ load(cacheEntries: ReadonlyArray>): void;
+}
+
+declare namespace LRUCache {
+ interface Options {
+ /**
+ * The maximum size of the cache, checked by applying the length
+ * function to all values in the cache. Not setting this is kind of silly,
+ * since that's the whole purpose of this lib, but it defaults to `Infinity`.
+ */
+ max?: number | undefined;
+
+ /**
+ * Maximum age in ms. Items are not pro-actively pruned out as they age,
+ * but if you try to get an item that is too old, it'll drop it and return
+ * undefined instead of giving it to you.
+ */
+ maxAge?: number | undefined;
+
+ /**
+ * Function that is used to calculate the length of stored items.
+ * If you're storing strings or buffers, then you probably want to do
+ * something like `function(n, key){return n.length}`. The default
+ * is `function(){return 1}`, which is fine if you want to store
+ * `max` like-sized things. The item is passed as the first argument,
+ * and the key is passed as the second argument.
+ */
+ length?(value: V, key?: K): number;
+
+ /**
+ * Function that is called on items when they are dropped from the cache.
+ * This can be handy if you want to close file descriptors or do other
+ * cleanup tasks when items are no longer accessible. Called with `key, value`.
+ * It's called before actually removing the item from the internal cache,
+ * so if you want to immediately put it back in, you'll have to do that in
+ * a `nextTick` or `setTimeout` callback or it won't do anything.
+ */
+ dispose?(key: K, value: V): void;
+
+ /**
+ * By default, if you set a `maxAge`, it'll only actually pull stale items
+ * out of the cache when you `get(key)`. (That is, it's not pre-emptively
+ * doing a `setTimeout` or anything.) If you set `stale:true`, it'll return
+ * the stale value before deleting it. If you don't set this, then it'll
+ * return `undefined` when you try to get a stale entry,
+ * as if it had already been deleted.
+ */
+ stale?: boolean | undefined;
+
+ /**
+ * By default, if you set a `dispose()` method, then it'll be called whenever
+ * a `set()` operation overwrites an existing key. If you set this option,
+ * `dispose()` will only be called when a key falls out of the cache,
+ * not when it is overwritten.
+ */
+ noDisposeOnSet?: boolean | undefined;
+
+ /**
+ * When using time-expiring entries with `maxAge`, setting this to `true` will make each
+ * item's effective time update to the current time whenever it is retrieved from cache,
+ * causing it to not expire. (It can still fall out of cache based on recency of use, of
+ * course.)
+ */
+ updateAgeOnGet?: boolean | undefined;
+ }
+
+ interface Entry {
+ k: K;
+ v: V;
+ e: number;
+ }
+}
+
+export = LRUCache;
diff --git a/node_modules/@types/lru-cache/package.json b/node_modules/@types/lru-cache/package.json
new file mode 100644
index 0000000..4da51e8
--- /dev/null
+++ b/node_modules/@types/lru-cache/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "@types/lru-cache",
+ "version": "5.1.1",
+ "description": "TypeScript definitions for lru-cache",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lru-cache",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Bart van der Schoor",
+ "url": "https://github.com/Bartvds",
+ "githubUsername": "Bartvds"
+ },
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender",
+ "githubUsername": "BendingBender"
+ }
+ ],
+ "main": "",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/lru-cache"
+ },
+ "scripts": {},
+ "dependencies": {},
+ "typesPublisherContentHash": "0ca9e508a03760598fc46f2d2546f293575b69fd823ccc42a80c56f579d650db",
+ "typeScriptVersion": "3.6"
+}
\ No newline at end of file
diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE
new file mode 100644
index 0000000..9e841e7
--- /dev/null
+++ b/node_modules/@types/node/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md
new file mode 100644
index 0000000..cb9e59f
--- /dev/null
+++ b/node_modules/@types/node/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/node`
+
+# Summary
+This package contains type definitions for Node.js (https://nodejs.org/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
+
+### Additional Details
+ * Last updated: Mon, 08 Nov 2021 21:31:28 GMT
+ * Dependencies: none
+ * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
+
+# Credits
+These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts
new file mode 100644
index 0000000..9f916c1
--- /dev/null
+++ b/node_modules/@types/node/assert.d.ts
@@ -0,0 +1,912 @@
+/**
+ * The `assert` module provides a set of assertion functions for verifying
+ * invariants.
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
+ */
+declare module 'assert' {
+ /**
+ * An alias of {@link ok}.
+ * @since v0.5.9
+ * @param value The input that is checked for being truthy.
+ */
+ function assert(value: unknown, message?: string | Error): asserts value;
+ namespace assert {
+ /**
+ * Indicates the failure of an assertion. All errors thrown by the `assert` module
+ * will be instances of the `AssertionError` class.
+ */
+ class AssertionError extends Error {
+ actual: unknown;
+ expected: unknown;
+ operator: string;
+ generatedMessage: boolean;
+ code: 'ERR_ASSERTION';
+ constructor(options?: {
+ /** If provided, the error message is set to this value. */
+ message?: string | undefined;
+ /** The `actual` property on the error instance. */
+ actual?: unknown | undefined;
+ /** The `expected` property on the error instance. */
+ expected?: unknown | undefined;
+ /** The `operator` property on the error instance. */
+ operator?: string | undefined;
+ /** If provided, the generated stack trace omits frames before this function. */
+ // tslint:disable-next-line:ban-types
+ stackStartFn?: Function | undefined;
+ });
+ }
+ /**
+ * This feature is currently experimental and behavior might still change.
+ * @since v14.2.0, v12.19.0
+ * @experimental
+ */
+ class CallTracker {
+ /**
+ * The wrapper function is expected to be called exactly `exact` times. If the
+ * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
+ * error.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func);
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @param [fn='A no-op function']
+ * @param [exact=1]
+ * @return that wraps `fn`.
+ */
+ calls(exact?: number): () => void;
+ calls any>(fn?: Func, exact?: number): Func;
+ /**
+ * The arrays contains information about the expected and actual number of calls of
+ * the functions that have not been called the expected number of times.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * function foo() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * // Returns an array containing information on callsfunc()
+ * tracker.report();
+ * // [
+ * // {
+ * // message: 'Expected the func function to be executed 2 time(s) but was
+ * // executed 0 time(s).',
+ * // actual: 0,
+ * // expected: 2,
+ * // operator: 'func',
+ * // stack: stack trace
+ * // }
+ * // ]
+ * ```
+ * @since v14.2.0, v12.19.0
+ * @return of objects containing information about the wrapper functions returned by `calls`.
+ */
+ report(): CallTrackerReportInformation[];
+ /**
+ * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that
+ * have not been called the expected number of times.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * // Creates call tracker.
+ * const tracker = new assert.CallTracker();
+ *
+ * function func() {}
+ *
+ * // Returns a function that wraps func() that must be called exact times
+ * // before tracker.verify().
+ * const callsfunc = tracker.calls(func, 2);
+ *
+ * callsfunc();
+ *
+ * // Will throw an error since callsfunc() was only called once.
+ * tracker.verify();
+ * ```
+ * @since v14.2.0, v12.19.0
+ */
+ verify(): void;
+ }
+ interface CallTrackerReportInformation {
+ message: string;
+ /** The actual number of times the function was called. */
+ actual: number;
+ /** The number of times the function was expected to be called. */
+ expected: number;
+ /** The name of the function that is wrapped. */
+ operator: string;
+ /** A stack trace of the function. */
+ stack: object;
+ }
+ type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
+ /**
+ * Throws an `AssertionError` with the provided error message or a default
+ * error message. If the `message` parameter is an instance of an `Error` then
+ * it will be thrown instead of the `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.fail();
+ * // AssertionError [ERR_ASSERTION]: Failed
+ *
+ * assert.fail('boom');
+ * // AssertionError [ERR_ASSERTION]: boom
+ *
+ * assert.fail(new TypeError('need array'));
+ * // TypeError: need array
+ * ```
+ *
+ * Using `assert.fail()` with more than two arguments is possible but deprecated.
+ * See below for further details.
+ * @since v0.1.21
+ * @param [message='Failed']
+ */
+ function fail(message?: string | Error): never;
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+ function fail(
+ actual: unknown,
+ expected: unknown,
+ message?: string | Error,
+ operator?: string,
+ // tslint:disable-next-line:ban-types
+ stackStartFn?: Function
+ ): never;
+ /**
+ * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
+ *
+ * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``.
+ *
+ * Be aware that in the `repl` the error message will be different to the one
+ * thrown in a file! See below for further details.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ok(true);
+ * // OK
+ * assert.ok(1);
+ * // OK
+ *
+ * assert.ok();
+ * // AssertionError: No value argument passed to `assert.ok()`
+ *
+ * assert.ok(false, 'it\'s false');
+ * // AssertionError: it's false
+ *
+ * // In the repl:
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: false == true
+ *
+ * // In a file (e.g. test.js):
+ * assert.ok(typeof 123 === 'string');
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(typeof 123 === 'string')
+ *
+ * assert.ok(false);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(false)
+ *
+ * assert.ok(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert.ok(0)
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * // Using `assert()` works the same:
+ * assert(0);
+ * // AssertionError: The expression evaluated to a falsy value:
+ * //
+ * // assert(0)
+ * ```
+ * @since v0.1.21
+ */
+ function ok(value: unknown, message?: string | Error): asserts value;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link strictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link strictEqual} instead.
+ *
+ * Tests shallow, coercive equality between the `actual` and `expected` parameters
+ * using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled
+ * and treated as being identical in case both sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.equal(1, 1);
+ * // OK, 1 == 1
+ * assert.equal(1, '1');
+ * // OK, 1 == '1'
+ * assert.equal(NaN, NaN);
+ * // OK
+ *
+ * assert.equal(1, 2);
+ * // AssertionError: 1 == 2
+ * assert.equal({ a: { b: 1 } }, { a: { b: 1 } });
+ * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
+ * ```
+ *
+ * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default
+ * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function equal(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
+ *
+ * Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as
+ * being identical in case both
+ * sides are `NaN`.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * assert.notEqual(1, 2);
+ * // OK
+ *
+ * assert.notEqual(1, 1);
+ * // AssertionError: 1 != 1
+ *
+ * assert.notEqual(1, '1');
+ * // AssertionError: 1 != '1'
+ * ```
+ *
+ * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error
+ * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
+ * @since v0.1.21
+ */
+ function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link deepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead.
+ *
+ * Tests for deep equality between the `actual` and `expected` parameters. Consider
+ * using {@link deepStrictEqual} instead. {@link deepEqual} can have
+ * surprising results.
+ *
+ * _Deep equality_ means that the enumerable "own" properties of child objects
+ * are also recursively evaluated by the following rules.
+ * @since v0.1.21
+ */
+ function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * **Strict assertion mode**
+ *
+ * An alias of {@link notDeepStrictEqual}.
+ *
+ * **Legacy assertion mode**
+ *
+ * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead.
+ *
+ * Tests for any deep inequality. Opposite of {@link deepEqual}.
+ *
+ * ```js
+ * import assert from 'assert';
+ *
+ * const obj1 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj2 = {
+ * a: {
+ * b: 2
+ * }
+ * };
+ * const obj3 = {
+ * a: {
+ * b: 1
+ * }
+ * };
+ * const obj4 = Object.create(obj1);
+ *
+ * assert.notDeepEqual(obj1, obj1);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj2);
+ * // OK
+ *
+ * assert.notDeepEqual(obj1, obj3);
+ * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
+ *
+ * assert.notDeepEqual(obj1, obj4);
+ * // OK
+ * ```
+ *
+ * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default
+ * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Tests strict equality between the `actual` and `expected` parameters as
+ * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.strictEqual(1, 2);
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * //
+ * // 1 !== 2
+ *
+ * assert.strictEqual(1, 1);
+ * // OK
+ *
+ * assert.strictEqual('Hello foobar', 'Hello World!');
+ * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+ * // + actual - expected
+ * //
+ * // + 'Hello foobar'
+ * // - 'Hello World!'
+ * // ^
+ *
+ * const apples = 1;
+ * const oranges = 2;
+ * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);
+ * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2
+ *
+ * assert.strictEqual(1, '1', new TypeError('Inputs are not identical'));
+ * // TypeError: Inputs are not identical
+ * ```
+ *
+ * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * Tests strict inequality between the `actual` and `expected` parameters as
+ * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notStrictEqual(1, 2);
+ * // OK
+ *
+ * assert.notStrictEqual(1, 1);
+ * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to:
+ * //
+ * // 1
+ *
+ * assert.notStrictEqual(1, '1');
+ * // OK
+ * ```
+ *
+ * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
+ * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v0.1.21
+ */
+ function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Tests for deep equality between the `actual` and `expected` parameters.
+ * "Deep" equality means that the enumerable "own" properties of child objects
+ * are recursively evaluated also by the following rules.
+ * @since v1.2.0
+ */
+ function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
+ /**
+ * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
+ * // OK
+ * ```
+ *
+ * If the values are deeply and strictly equal, an `AssertionError` is thrown
+ * with a `message` property set equal to the value of the `message` parameter. If
+ * the `message` parameter is undefined, a default error message is assigned. If
+ * the `message` parameter is an instance of an `Error` then it will be thrown
+ * instead of the `AssertionError`.
+ * @since v1.2.0
+ */
+ function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
+ /**
+ * Expects the function `fn` to throw an error.
+ *
+ * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function,
+ * a validation object where each property will be tested for strict deep equality,
+ * or an instance of error where each property will be tested for strict deep
+ * equality including the non-enumerable `message` and `name` properties. When
+ * using an object, it is also possible to use a regular expression, when
+ * validating against a string property. See below for examples.
+ *
+ * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation
+ * fails.
+ *
+ * Custom validation object/error instance:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * const err = new TypeError('Wrong value');
+ * err.code = 404;
+ * err.foo = 'bar';
+ * err.info = {
+ * nested: true,
+ * baz: 'text'
+ * };
+ * err.reg = /abc/i;
+ *
+ * assert.throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value',
+ * info: {
+ * nested: true,
+ * baz: 'text'
+ * }
+ * // Only properties on the validation object will be tested for.
+ * // Using nested objects requires all properties to be present. Otherwise
+ * // the validation is going to fail.
+ * }
+ * );
+ *
+ * // Using regular expressions to validate error properties:
+ * throws(
+ * () => {
+ * throw err;
+ * },
+ * {
+ * // The `name` and `message` properties are strings and using regular
+ * // expressions on those will match against the string. If they fail, an
+ * // error is thrown.
+ * name: /^TypeError$/,
+ * message: /Wrong/,
+ * foo: 'bar',
+ * info: {
+ * nested: true,
+ * // It is not possible to use regular expressions for nested properties!
+ * baz: 'text'
+ * },
+ * // The `reg` property contains a regular expression and only if the
+ * // validation object contains an identical regular expression, it is going
+ * // to pass.
+ * reg: /abc/i
+ * }
+ * );
+ *
+ * // Fails due to the different `message` and `name` properties:
+ * throws(
+ * () => {
+ * const otherErr = new Error('Not found');
+ * // Copy all enumerable properties from `err` to `otherErr`.
+ * for (const [key, value] of Object.entries(err)) {
+ * otherErr[key] = value;
+ * }
+ * throw otherErr;
+ * },
+ * // The error's `message` and `name` properties will also be checked when using
+ * // an error as validation object.
+ * err
+ * );
+ * ```
+ *
+ * Validate instanceof using constructor:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * Error
+ * );
+ * ```
+ *
+ * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions):
+ *
+ * Using a regular expression runs `.toString` on the error object, and will
+ * therefore also include the error name.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * /^Error: Wrong value$/
+ * );
+ * ```
+ *
+ * Custom error validation:
+ *
+ * The function must return `true` to indicate all internal validations passed.
+ * It will otherwise fail with an `AssertionError`.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.throws(
+ * () => {
+ * throw new Error('Wrong value');
+ * },
+ * (err) => {
+ * assert(err instanceof Error);
+ * assert(/value/.test(err));
+ * // Avoid returning anything from validation functions besides `true`.
+ * // Otherwise, it's not clear what part of the validation failed. Instead,
+ * // throw an error about the specific validation that failed (as done in this
+ * // example) and add as much helpful debugging information to that error as
+ * // possible.
+ * return true;
+ * },
+ * 'unexpected error'
+ * );
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same
+ * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using
+ * a string as the second argument gets considered:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * function throwingFirst() {
+ * throw new Error('First');
+ * }
+ *
+ * function throwingSecond() {
+ * throw new Error('Second');
+ * }
+ *
+ * function notThrowing() {}
+ *
+ * // The second argument is a string and the input function threw an Error.
+ * // The first case will not throw as it does not match for the error message
+ * // thrown by the input function!
+ * assert.throws(throwingFirst, 'Second');
+ * // In the next example the message has no benefit over the message from the
+ * // error and since it is not clear if the user intended to actually match
+ * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.
+ * assert.throws(throwingSecond, 'Second');
+ * // TypeError [ERR_AMBIGUOUS_ARGUMENT]
+ *
+ * // The string is only used (as message) in case the function does not throw:
+ * assert.throws(notThrowing, 'Second');
+ * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second
+ *
+ * // If it was intended to match for the error message do this instead:
+ * // It does not throw because the error messages match.
+ * assert.throws(throwingSecond, /Second$/);
+ *
+ * // If the error message does not match, an AssertionError is thrown.
+ * assert.throws(throwingFirst, /Second$/);
+ * // AssertionError [ERR_ASSERTION]
+ * ```
+ *
+ * Due to the confusing error-prone notation, avoid a string as the second
+ * argument.
+ * @since v0.1.21
+ */
+ function throws(block: () => unknown, message?: string | Error): void;
+ function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Asserts that the function `fn` does not throw an error.
+ *
+ * Using `assert.doesNotThrow()` is actually not useful because there
+ * is no benefit in catching an error and then rethrowing it. Instead, consider
+ * adding a comment next to the specific code path that should not throw and keep
+ * error messages as expressive as possible.
+ *
+ * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function.
+ *
+ * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a
+ * different type, or if the `error` parameter is undefined, the error is
+ * propagated back to the caller.
+ *
+ * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
+ * function. See {@link throws} for more details.
+ *
+ * The following, for instance, will throw the `TypeError` because there is no
+ * matching error type in the assertion:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * However, the following will result in an `AssertionError` with the message
+ * 'Got unwanted exception...':
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * TypeError
+ * );
+ * ```
+ *
+ * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotThrow(
+ * () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * /Wrong value/,
+ * 'Whoops'
+ * );
+ * // Throws: AssertionError: Got unwanted exception: Whoops
+ * ```
+ * @since v0.1.21
+ */
+ function doesNotThrow(block: () => unknown, message?: string | Error): void;
+ function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
+ /**
+ * Throws `value` if `value` is not `undefined` or `null`. This is useful when
+ * testing the `error` argument in callbacks. The stack trace contains all frames
+ * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.ifError(null);
+ * // OK
+ * assert.ifError(0);
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0
+ * assert.ifError('error');
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'
+ * assert.ifError(new Error());
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error
+ *
+ * // Create some random error frames.
+ * let err;
+ * (function errorFrame() {
+ * err = new Error('test error');
+ * })();
+ *
+ * (function ifErrorFrame() {
+ * assert.ifError(err);
+ * })();
+ * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
+ * // at ifErrorFrame
+ * // at errorFrame
+ * ```
+ * @since v0.1.97
+ */
+ function ifError(value: unknown): asserts value is null | undefined;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the
+ * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error
+ * handler is skipped.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link throws}.
+ *
+ * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function,
+ * an object where each property will be tested for, or an instance of error where
+ * each property will be tested for including the non-enumerable `message` and`name` properties.
+ *
+ * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * {
+ * name: 'TypeError',
+ * message: 'Wrong value'
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.rejects(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * (err) => {
+ * assert.strictEqual(err.name, 'TypeError');
+ * assert.strictEqual(err.message, 'Wrong value');
+ * return true;
+ * }
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.rejects(
+ * Promise.reject(new Error('Wrong value')),
+ * Error
+ * ).then(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * `error` cannot be a string. If a string is provided as the second
+ * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the
+ * example in {@link throws} carefully if using a string as the second
+ * argument gets considered.
+ * @since v10.0.0
+ */
+ function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise;
+ function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise;
+ /**
+ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
+ * calls the function and awaits the returned promise to complete. It will then
+ * check that the promise is not rejected.
+ *
+ * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If
+ * the function does not return a promise, `assert.doesNotReject()` will return a
+ * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases
+ * the error handler is skipped.
+ *
+ * Using `assert.doesNotReject()` is actually not useful because there is little
+ * benefit in catching a rejection and then rejecting it again. Instead, consider
+ * adding a comment next to the specific code path that should not reject and keep
+ * error messages as expressive as possible.
+ *
+ * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
+ * function. See {@link throws} for more details.
+ *
+ * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * await assert.doesNotReject(
+ * async () => {
+ * throw new TypeError('Wrong value');
+ * },
+ * SyntaxError
+ * );
+ * ```
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
+ * .then(() => {
+ * // ...
+ * });
+ * ```
+ * @since v10.0.0
+ */
+ function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise;
+ function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise;
+ /**
+ * Expects the `string` input to match the regular expression.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.match('I will fail', /pass/);
+ * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
+ *
+ * assert.match(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.match('I will pass', /pass/);
+ * // OK
+ * ```
+ *
+ * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function match(value: string, regExp: RegExp, message?: string | Error): void;
+ /**
+ * Expects the `string` input not to match the regular expression.
+ *
+ * ```js
+ * import assert from 'assert/strict';
+ *
+ * assert.doesNotMatch('I will fail', /fail/);
+ * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
+ *
+ * assert.doesNotMatch(123, /pass/);
+ * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
+ *
+ * assert.doesNotMatch('I will pass', /different/);
+ * // OK
+ * ```
+ *
+ * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
+ * to the value of the `message` parameter. If the `message` parameter is
+ * undefined, a default error message is assigned. If the `message` parameter is an
+ * instance of an `Error` then it will be thrown instead of the `AssertionError`.
+ * @since v13.6.0, v12.16.0
+ */
+ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+ const strict: Omit & {
+ (value: unknown, message?: string | Error): asserts value;
+ equal: typeof strictEqual;
+ notEqual: typeof notStrictEqual;
+ deepEqual: typeof deepStrictEqual;
+ notDeepEqual: typeof notDeepStrictEqual;
+ // Mapped types and assertion functions are incompatible?
+ // TS2775: Assertions require every name in the call target
+ // to be declared with an explicit type annotation.
+ ok: typeof ok;
+ strictEqual: typeof strictEqual;
+ deepStrictEqual: typeof deepStrictEqual;
+ ifError: typeof ifError;
+ strict: typeof strict;
+ };
+ }
+ export = assert;
+}
+declare module 'node:assert' {
+ import assert = require('assert');
+ export = assert;
+}
diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts
new file mode 100644
index 0000000..b4319b9
--- /dev/null
+++ b/node_modules/@types/node/assert/strict.d.ts
@@ -0,0 +1,8 @@
+declare module 'assert/strict' {
+ import { strict } from 'node:assert';
+ export = strict;
+}
+declare module 'node:assert/strict' {
+ import { strict } from 'node:assert';
+ export = strict;
+}
diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts
new file mode 100644
index 0000000..35b9be2
--- /dev/null
+++ b/node_modules/@types/node/async_hooks.d.ts
@@ -0,0 +1,497 @@
+/**
+ * The `async_hooks` module provides an API to track asynchronous resources. It
+ * can be accessed using:
+ *
+ * ```js
+ * import async_hooks from 'async_hooks';
+ * ```
+ * @experimental
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
+ */
+declare module 'async_hooks' {
+ /**
+ * ```js
+ * import { executionAsyncId } from 'async_hooks';
+ *
+ * console.log(executionAsyncId()); // 1 - bootstrap
+ * fs.open(path, 'r', (err, fd) => {
+ * console.log(executionAsyncId()); // 6 - open()
+ * });
+ * ```
+ *
+ * The ID returned from `executionAsyncId()` is related to execution timing, not
+ * causality (which is covered by `triggerAsyncId()`):
+ *
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // Returns the ID of the server, not of the new connection, because the
+ * // callback runs in the execution scope of the server's MakeCallback().
+ * async_hooks.executionAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Returns the ID of a TickObject (process.nextTick()) because all
+ * // callbacks passed to .listen() are wrapped in a nextTick().
+ * async_hooks.executionAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get precise `executionAsyncIds` by default.
+ * See the section on `promise execution tracking`.
+ * @since v8.1.0
+ * @return The `asyncId` of the current execution context. Useful to track when something calls.
+ */
+ function executionAsyncId(): number;
+ /**
+ * Resource objects returned by `executionAsyncResource()` are most often internal
+ * Node.js handle objects with undocumented APIs. Using any functions or properties
+ * on the object is likely to crash your application and should be avoided.
+ *
+ * Using `executionAsyncResource()` in the top-level execution context will
+ * return an empty object as there is no handle or request object to use,
+ * but having an object representing the top-level can be helpful.
+ *
+ * ```js
+ * import { open } from 'fs';
+ * import { executionAsyncId, executionAsyncResource } from 'async_hooks';
+ *
+ * console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
+ * open(new URL(import.meta.url), 'r', (err, fd) => {
+ * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
+ * });
+ * ```
+ *
+ * This can be used to implement continuation local storage without the
+ * use of a tracking `Map` to store the metadata:
+ *
+ * ```js
+ * import { createServer } from 'http';
+ * import {
+ * executionAsyncId,
+ * executionAsyncResource,
+ * createHook
+ * } from 'async_hooks';
+ * const sym = Symbol('state'); // Private symbol to avoid pollution
+ *
+ * createHook({
+ * init(asyncId, type, triggerAsyncId, resource) {
+ * const cr = executionAsyncResource();
+ * if (cr) {
+ * resource[sym] = cr[sym];
+ * }
+ * }
+ * }).enable();
+ *
+ * const server = createServer((req, res) => {
+ * executionAsyncResource()[sym] = { state: req.url };
+ * setTimeout(function() {
+ * res.end(JSON.stringify(executionAsyncResource()[sym]));
+ * }, 100);
+ * }).listen(3000);
+ * ```
+ * @since v13.9.0, v12.17.0
+ * @return The resource representing the current execution. Useful to store data within the resource.
+ */
+ function executionAsyncResource(): object;
+ /**
+ * ```js
+ * const server = net.createServer((conn) => {
+ * // The resource that caused (or triggered) this callback to be called
+ * // was that of the new connection. Thus the return value of triggerAsyncId()
+ * // is the asyncId of "conn".
+ * async_hooks.triggerAsyncId();
+ *
+ * }).listen(port, () => {
+ * // Even though all callbacks passed to .listen() are wrapped in a nextTick()
+ * // the callback itself exists because the call to the server's .listen()
+ * // was made. So the return value would be the ID of the server.
+ * async_hooks.triggerAsyncId();
+ * });
+ * ```
+ *
+ * Promise contexts may not get valid `triggerAsyncId`s by default. See
+ * the section on `promise execution tracking`.
+ * @return The ID of the resource responsible for calling the callback that is currently being executed.
+ */
+ function triggerAsyncId(): number;
+ interface HookCallbacks {
+ /**
+ * Called when a class is constructed that has the possibility to emit an asynchronous event.
+ * @param asyncId a unique ID for the async resource
+ * @param type the type of the async resource
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
+ * @param resource reference to the resource representing the async operation, needs to be released during destroy
+ */
+ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
+ /**
+ * When an asynchronous operation is initiated or completes a callback is called to notify the user.
+ * The before callback is called just before said callback is executed.
+ * @param asyncId the unique identifier assigned to the resource about to execute the callback.
+ */
+ before?(asyncId: number): void;
+ /**
+ * Called immediately after the callback specified in before is completed.
+ * @param asyncId the unique identifier assigned to the resource which has executed the callback.
+ */
+ after?(asyncId: number): void;
+ /**
+ * Called when a promise has resolve() called. This may not be in the same execution id
+ * as the promise itself.
+ * @param asyncId the unique id for the promise that was resolve()d.
+ */
+ promiseResolve?(asyncId: number): void;
+ /**
+ * Called after the resource corresponding to asyncId is destroyed
+ * @param asyncId a unique ID for the async resource
+ */
+ destroy?(asyncId: number): void;
+ }
+ interface AsyncHook {
+ /**
+ * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
+ */
+ enable(): this;
+ /**
+ * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
+ */
+ disable(): this;
+ }
+ /**
+ * Registers functions to be called for different lifetime events of each async
+ * operation.
+ *
+ * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
+ * respective asynchronous event during a resource's lifetime.
+ *
+ * All callbacks are optional. For example, if only resource cleanup needs to
+ * be tracked, then only the `destroy` callback needs to be passed. The
+ * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
+ *
+ * ```js
+ * import { createHook } from 'async_hooks';
+ *
+ * const asyncHook = createHook({
+ * init(asyncId, type, triggerAsyncId, resource) { },
+ * destroy(asyncId) { }
+ * });
+ * ```
+ *
+ * The callbacks will be inherited via the prototype chain:
+ *
+ * ```js
+ * class MyAsyncCallbacks {
+ * init(asyncId, type, triggerAsyncId, resource) { }
+ * destroy(asyncId) {}
+ * }
+ *
+ * class MyAddedCallbacks extends MyAsyncCallbacks {
+ * before(asyncId) { }
+ * after(asyncId) { }
+ * }
+ *
+ * const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
+ * ```
+ *
+ * Because promises are asynchronous resources whose lifecycle is tracked
+ * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
+ * @since v8.1.0
+ * @param callbacks The `Hook Callbacks` to register
+ * @return Instance used for disabling and enabling hooks
+ */
+ function createHook(callbacks: HookCallbacks): AsyncHook;
+ interface AsyncResourceOptions {
+ /**
+ * The ID of the execution context that created this async event.
+ * @default executionAsyncId()
+ */
+ triggerAsyncId?: number | undefined;
+ /**
+ * Disables automatic `emitDestroy` when the object is garbage collected.
+ * This usually does not need to be set (even if `emitDestroy` is called
+ * manually), unless the resource's `asyncId` is retrieved and the
+ * sensitive API's `emitDestroy` is called with it.
+ * @default false
+ */
+ requireManualDestroy?: boolean | undefined;
+ }
+ /**
+ * The class `AsyncResource` is designed to be extended by the embedder's async
+ * resources. Using this, users can easily trigger the lifetime events of their
+ * own resources.
+ *
+ * The `init` hook will trigger when an `AsyncResource` is instantiated.
+ *
+ * The following is an overview of the `AsyncResource` API.
+ *
+ * ```js
+ * import { AsyncResource, executionAsyncId } from 'async_hooks';
+ *
+ * // AsyncResource() is meant to be extended. Instantiating a
+ * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * // async_hook.executionAsyncId() is used.
+ * const asyncResource = new AsyncResource(
+ * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }
+ * );
+ *
+ * // Run a function in the execution context of the resource. This will
+ * // * establish the context of the resource
+ * // * trigger the AsyncHooks before callbacks
+ * // * call the provided function `fn` with the supplied arguments
+ * // * trigger the AsyncHooks after callbacks
+ * // * restore the original execution context
+ * asyncResource.runInAsyncScope(fn, thisArg, ...args);
+ *
+ * // Call AsyncHooks destroy callbacks.
+ * asyncResource.emitDestroy();
+ *
+ * // Return the unique ID assigned to the AsyncResource instance.
+ * asyncResource.asyncId();
+ *
+ * // Return the trigger ID for the AsyncResource instance.
+ * asyncResource.triggerAsyncId();
+ * ```
+ */
+ class AsyncResource {
+ /**
+ * AsyncResource() is meant to be extended. Instantiating a
+ * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * async_hook.executionAsyncId() is used.
+ * @param type The type of async event.
+ * @param triggerAsyncId The ID of the execution context that created
+ * this async event (default: `executionAsyncId()`), or an
+ * AsyncResourceOptions object (since 9.3)
+ */
+ constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
+ /**
+ * Binds the given function to the current execution context.
+ *
+ * The returned function will have an `asyncResource` property referencing
+ * the `AsyncResource` to which the function is bound.
+ * @since v14.8.0, v12.19.0
+ * @param fn The function to bind to the current execution context.
+ * @param type An optional name to associate with the underlying `AsyncResource`.
+ */
+ static bind any, ThisArg>(
+ fn: Func,
+ type?: string,
+ thisArg?: ThisArg
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Binds the given function to execute to this `AsyncResource`'s scope.
+ *
+ * The returned function will have an `asyncResource` property referencing
+ * the `AsyncResource` to which the function is bound.
+ * @since v14.8.0, v12.19.0
+ * @param fn The function to bind to the current `AsyncResource`.
+ */
+ bind any>(
+ fn: Func
+ ): Func & {
+ asyncResource: AsyncResource;
+ };
+ /**
+ * Call the provided function with the provided arguments in the execution context
+ * of the async resource. This will establish the context, trigger the AsyncHooks
+ * before callbacks, call the function, trigger the AsyncHooks after callbacks, and
+ * then restore the original execution context.
+ * @since v9.6.0
+ * @param fn The function to call in the execution context of this async resource.
+ * @param thisArg The receiver to be used for the function call.
+ * @param args Optional arguments to pass to the function.
+ */
+ runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
+ /**
+ * Call all `destroy` hooks. This should only ever be called once. An error will
+ * be thrown if it is called more than once. This **must** be manually called. If
+ * the resource is left to be collected by the GC then the `destroy` hooks will
+ * never be called.
+ * @return A reference to `asyncResource`.
+ */
+ emitDestroy(): this;
+ /**
+ * @return The unique `asyncId` assigned to the resource.
+ */
+ asyncId(): number;
+ /**
+ *
+ * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
+ */
+ triggerAsyncId(): number;
+ }
+ /**
+ * This class creates stores that stay coherent through asynchronous operations.
+ *
+ * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe
+ * implementation that involves significant optimizations that are non-obvious to
+ * implement.
+ *
+ * The following example uses `AsyncLocalStorage` to build a simple logger
+ * that assigns IDs to incoming HTTP requests and includes them in messages
+ * logged within each request.
+ *
+ * ```js
+ * import http from 'http';
+ * import { AsyncLocalStorage } from 'async_hooks';
+ *
+ * const asyncLocalStorage = new AsyncLocalStorage();
+ *
+ * function logWithId(msg) {
+ * const id = asyncLocalStorage.getStore();
+ * console.log(`${id !== undefined ? id : '-'}:`, msg);
+ * }
+ *
+ * let idSeq = 0;
+ * http.createServer((req, res) => {
+ * asyncLocalStorage.run(idSeq++, () => {
+ * logWithId('start');
+ * // Imagine any chain of async operations here
+ * setImmediate(() => {
+ * logWithId('finish');
+ * res.end();
+ * });
+ * });
+ * }).listen(8080);
+ *
+ * http.get('http://localhost:8080');
+ * http.get('http://localhost:8080');
+ * // Prints:
+ * // 0: start
+ * // 1: start
+ * // 0: finish
+ * // 1: finish
+ * ```
+ *
+ * Each instance of `AsyncLocalStorage` maintains an independent storage context.
+ * Multiple instances can safely exist simultaneously without risk of interfering
+ * with each other data.
+ * @since v13.10.0, v12.17.0
+ */
+ class AsyncLocalStorage {
+ /**
+ * Disables the instance of `AsyncLocalStorage`. All subsequent calls
+ * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
+ *
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
+ * instance will be exited.
+ *
+ * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
+ * along with the corresponding async resources.
+ *
+ * Use this method when the `asyncLocalStorage` is not in use anymore
+ * in the current process.
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ disable(): void;
+ /**
+ * Returns the current store.
+ * If called outside of an asynchronous context initialized by
+ * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
+ * returns `undefined`.
+ * @since v13.10.0, v12.17.0
+ */
+ getStore(): T | undefined;
+ /**
+ * Runs a function synchronously within a context and returns its
+ * return value. The store is not accessible outside of the callback function or
+ * the asynchronous operations created within the callback.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `run()` too.
+ * The stacktrace is not impacted by this call and the context is exited.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 2 };
+ * try {
+ * asyncLocalStorage.run(store, () => {
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * // The error will be caught here
+ * }
+ * ```
+ * @since v13.10.0, v12.17.0
+ */
+ run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
+ /**
+ * Runs a function synchronously outside of a context and returns its
+ * return value. The store is not accessible within the callback function or
+ * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`.
+ *
+ * The optional `args` are passed to the callback function.
+ *
+ * If the callback function throws an error, the error is thrown by `exit()` too.
+ * The stacktrace is not impacted by this call and the context is re-entered.
+ *
+ * Example:
+ *
+ * ```js
+ * // Within a call to run
+ * try {
+ * asyncLocalStorage.getStore(); // Returns the store object or value
+ * asyncLocalStorage.exit(() => {
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * throw new Error();
+ * });
+ * } catch (e) {
+ * asyncLocalStorage.getStore(); // Returns the same object or value
+ * // The error will be caught here
+ * }
+ * ```
+ * @since v13.10.0, v12.17.0
+ * @experimental
+ */
+ exit(callback: (...args: TArgs) => R, ...args: TArgs): R;
+ /**
+ * Transitions into the context for the remainder of the current
+ * synchronous execution and then persists the store through any following
+ * asynchronous calls.
+ *
+ * Example:
+ *
+ * ```js
+ * const store = { id: 1 };
+ * // Replaces previous store with the given store object
+ * asyncLocalStorage.enterWith(store);
+ * asyncLocalStorage.getStore(); // Returns the store object
+ * someAsyncOperation(() => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ * ```
+ *
+ * This transition will continue for the _entire_ synchronous execution.
+ * This means that if, for example, the context is entered within an event
+ * handler subsequent event handlers will also run within that context unless
+ * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons
+ * to use the latter method.
+ *
+ * ```js
+ * const store = { id: 1 };
+ *
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.enterWith(store);
+ * });
+ * emitter.on('my-event', () => {
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * });
+ *
+ * asyncLocalStorage.getStore(); // Returns undefined
+ * emitter.emit('my-event');
+ * asyncLocalStorage.getStore(); // Returns the same object
+ * ```
+ * @since v13.11.0, v12.17.0
+ * @experimental
+ */
+ enterWith(store: T): void;
+ }
+}
+declare module 'node:async_hooks' {
+ export * from 'async_hooks';
+}
diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts
new file mode 100644
index 0000000..cfcd33e
--- /dev/null
+++ b/node_modules/@types/node/buffer.d.ts
@@ -0,0 +1,2142 @@
+/**
+ * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
+ * Node.js APIs support `Buffer`s.
+ *
+ * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
+ * extends it with methods that cover additional use cases. Node.js APIs accept
+ * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
+ *
+ * While the `Buffer` class is available within the global scope, it is still
+ * recommended to explicitly reference it via an import or require statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a zero-filled Buffer of length 10.
+ * const buf1 = Buffer.alloc(10);
+ *
+ * // Creates a Buffer of length 10,
+ * // filled with bytes which all have the value `1`.
+ * const buf2 = Buffer.alloc(10, 1);
+ *
+ * // Creates an uninitialized buffer of length 10.
+ * // This is faster than calling Buffer.alloc() but the returned
+ * // Buffer instance might contain old data that needs to be
+ * // overwritten using fill(), write(), or other functions that fill the Buffer's
+ * // contents.
+ * const buf3 = Buffer.allocUnsafe(10);
+ *
+ * // Creates a Buffer containing the bytes [1, 2, 3].
+ * const buf4 = Buffer.from([1, 2, 3]);
+ *
+ * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
+ * // are all truncated using `(value & 255)` to fit into the range 0–255.
+ * const buf5 = Buffer.from([257, 257.5, -255, '1']);
+ *
+ * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
+ * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
+ * // [116, 195, 169, 115, 116] (in decimal notation)
+ * const buf6 = Buffer.from('tést');
+ *
+ * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
+ * const buf7 = Buffer.from('tést', 'latin1');
+ * ```
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/buffer.js)
+ */
+declare module 'buffer' {
+ import { BinaryLike } from 'node:crypto';
+ export const INSPECT_MAX_BYTES: number;
+ export const kMaxLength: number;
+ export const kStringMaxLength: number;
+ export const constants: {
+ MAX_LENGTH: number;
+ MAX_STRING_LENGTH: number;
+ };
+ export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary';
+ /**
+ * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
+ * encoding to another. Returns a new `Buffer` instance.
+ *
+ * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
+ * conversion from `fromEnc` to `toEnc` is not permitted.
+ *
+ * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
+ *
+ * The transcoding process will use substitution characters if a given byte
+ * sequence cannot be adequately represented in the target encoding. For instance:
+ *
+ * ```js
+ * import { Buffer, transcode } from 'buffer';
+ *
+ * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
+ * console.log(newBuf.toString('ascii'));
+ * // Prints: '?'
+ * ```
+ *
+ * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
+ * with `?` in the transcoded `Buffer`.
+ * @since v7.1.0
+ * @param source A `Buffer` or `Uint8Array` instance.
+ * @param fromEnc The current encoding.
+ * @param toEnc To target encoding.
+ */
+ export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
+ export const SlowBuffer: {
+ /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
+ new (size: number): Buffer;
+ prototype: Buffer;
+ };
+ /**
+ * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
+ * a prior call to `URL.createObjectURL()`.
+ * @since v16.7.0
+ * @experimental
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
+ */
+ export function resolveObjectURL(id: string): Blob | undefined;
+ export { Buffer };
+ /**
+ * @experimental
+ */
+ export interface BlobOptions {
+ /**
+ * @default 'utf8'
+ */
+ encoding?: BufferEncoding | undefined;
+ /**
+ * The Blob content-type. The intent is for `type` to convey
+ * the MIME media type of the data, however no validation of the type format
+ * is performed.
+ */
+ type?: string | undefined;
+ }
+ /**
+ * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
+ * multiple worker threads.
+ * @since v15.7.0
+ * @experimental
+ */
+ export class Blob {
+ /**
+ * The total size of the `Blob` in bytes.
+ * @since v15.7.0
+ */
+ readonly size: number;
+ /**
+ * The content-type of the `Blob`.
+ * @since v15.7.0
+ */
+ readonly type: string;
+ /**
+ * Creates a new `Blob` object containing a concatenation of the given sources.
+ *
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
+ *
+ * String sources are also copied into the `Blob`.
+ */
+ constructor(sources: Array, options?: BlobOptions);
+ /**
+ * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
+ * the `Blob` data.
+ * @since v15.7.0
+ */
+ arrayBuffer(): Promise;
+ /**
+ * Creates and returns a new `Blob` containing a subset of this `Blob` objects
+ * data. The original `Blob` is not altered.
+ * @since v15.7.0
+ * @param start The starting index.
+ * @param end The ending index.
+ * @param type The content-type for the new `Blob`
+ */
+ slice(start?: number, end?: number, type?: string): Blob;
+ /**
+ * Returns a promise that fulfills with the contents of the `Blob` decoded as a
+ * UTF-8 string.
+ * @since v15.7.0
+ */
+ text(): Promise;
+ /**
+ * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
+ * @since v16.7.0
+ */
+ stream(): unknown; // pending web streams types
+ }
+ export import atob = globalThis.atob;
+ export import btoa = globalThis.btoa;
+ global {
+ // Buffer class
+ type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
+ type WithImplicitCoercion =
+ | T
+ | {
+ valueOf(): T;
+ };
+ /**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
+ */
+ interface BufferConstructor {
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
+ */
+ new (str: string, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
+ */
+ new (size: number): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new (array: Uint8Array): Buffer;
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
+ */
+ new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+ */
+ new (array: ReadonlyArray): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
+ */
+ new (buffer: Buffer): Buffer;
+ /**
+ * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
+ * Array entries outside that range will be truncated to fit into it.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
+ * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
+ * ```
+ *
+ * A `TypeError` will be thrown if `array` is not an `Array` or another type
+ * appropriate for `Buffer.from()` variants.
+ *
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v5.10.0
+ */
+ from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param data data to create a new Buffer
+ */
+ from(data: Uint8Array | ReadonlyArray): Buffer;
+ from(data: WithImplicitCoercion | string>): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ */
+ from(
+ str:
+ | WithImplicitCoercion
+ | {
+ [Symbol.toPrimitive](hint: 'string'): string;
+ },
+ encoding?: BufferEncoding
+ ): Buffer;
+ /**
+ * Creates a new Buffer using the passed {data}
+ * @param values to create a new Buffer
+ */
+ of(...items: number[]): Buffer;
+ /**
+ * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * Buffer.isBuffer(Buffer.alloc(10)); // true
+ * Buffer.isBuffer(Buffer.from('foo')); // true
+ * Buffer.isBuffer('a string'); // false
+ * Buffer.isBuffer([]); // false
+ * Buffer.isBuffer(new Uint8Array(1024)); // false
+ * ```
+ * @since v0.1.101
+ */
+ isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns `true` if `encoding` is the name of a supported character encoding,
+ * or `false` otherwise.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * console.log(Buffer.isEncoding('utf8'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('hex'));
+ * // Prints: true
+ *
+ * console.log(Buffer.isEncoding('utf/8'));
+ * // Prints: false
+ *
+ * console.log(Buffer.isEncoding(''));
+ * // Prints: false
+ * ```
+ * @since v0.9.1
+ * @param encoding A character encoding name to check.
+ */
+ isEncoding(encoding: string): encoding is BufferEncoding;
+ /**
+ * Returns the byte length of a string when encoded using `encoding`.
+ * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
+ * for the encoding that is used to convert the string into bytes.
+ *
+ * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
+ * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
+ * return value might be greater than the length of a `Buffer` created from the
+ * string.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const str = '\u00bd + \u00bc = \u00be';
+ *
+ * console.log(`${str}: ${str.length} characters, ` +
+ * `${Buffer.byteLength(str, 'utf8')} bytes`);
+ * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
+ * ```
+ *
+ * When `string` is a
+ * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
+ * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
+ * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
+ * @since v0.1.90
+ * @param string A value to calculate the length of.
+ * @param [encoding='utf8'] If `string` is a string, this is its encoding.
+ * @return The number of bytes contained within `string`.
+ */
+ byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number;
+ /**
+ * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
+ *
+ * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned.
+ *
+ * If `totalLength` is not provided, it is calculated from the `Buffer` instances
+ * in `list` by adding their lengths.
+ *
+ * If `totalLength` is provided, it is coerced to an unsigned integer. If the
+ * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
+ * truncated to `totalLength`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a single `Buffer` from a list of three `Buffer` instances.
+ *
+ * const buf1 = Buffer.alloc(10);
+ * const buf2 = Buffer.alloc(14);
+ * const buf3 = Buffer.alloc(18);
+ * const totalLength = buf1.length + buf2.length + buf3.length;
+ *
+ * console.log(totalLength);
+ * // Prints: 42
+ *
+ * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
+ *
+ * console.log(bufA);
+ * // Prints:
+ * console.log(bufA.length);
+ * // Prints: 42
+ * ```
+ *
+ * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
+ * @since v0.7.11
+ * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
+ * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
+ */
+ concat(list: ReadonlyArray, totalLength?: number): Buffer;
+ /**
+ * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('1234');
+ * const buf2 = Buffer.from('0123');
+ * const arr = [buf1, buf2];
+ *
+ * console.log(arr.sort(Buffer.compare));
+ * // Prints: [ , ]
+ * // (This result is equal to: [buf2, buf1].)
+ * ```
+ * @since v0.11.13
+ * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
+ */
+ compare(buf1: Uint8Array, buf2: Uint8Array): number;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ *
+ * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(5, 'a');
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ *
+ * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+ * initialized by calling `buf.fill(fill, encoding)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ *
+ * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
+ * contents will never contain sensitive data from previous allocations, including
+ * data that might not have been allocated for `Buffer`s.
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ * @param [fill=0] A value to pre-fill the new `Buffer` with.
+ * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
+ */
+ alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(10);
+ *
+ * console.log(buf);
+ * // Prints (contents may vary):
+ *
+ * buf.fill(0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ *
+ * The `Buffer` module pre-allocates an internal `Buffer` instance of
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
+ * deprecated`new Buffer(size)` constructor only when `size` is less than or equal
+ * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
+ *
+ * Use of this pre-allocated internal memory pool is a key difference between
+ * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+ * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
+ * than or equal to half `Buffer.poolSize`. The
+ * difference is subtle but can be important when an application requires the
+ * additional performance that `Buffer.allocUnsafe()` provides.
+ * @since v5.10.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created
+ * if `size` is 0.
+ *
+ * The underlying memory for `Buffer` instances created in this way is _not_
+ * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `buf.fill(0)` to initialize
+ * such `Buffer` instances with zeroes.
+ *
+ * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+ * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This
+ * allows applications to avoid the garbage collection overhead of creating many
+ * individually allocated `Buffer` instances. This approach improves both
+ * performance and memory usage by eliminating the need to track and clean up as
+ * many individual `ArrayBuffer` objects.
+ *
+ * However, in the case where a developer may need to retain a small chunk of
+ * memory from a pool for an indeterminate amount of time, it may be appropriate
+ * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
+ * then copying out the relevant bits.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Need to keep around a few small chunks of memory.
+ * const store = [];
+ *
+ * socket.on('readable', () => {
+ * let data;
+ * while (null !== (data = readable.read())) {
+ * // Allocate for retained data.
+ * const sb = Buffer.allocUnsafeSlow(10);
+ *
+ * // Copy the data into the new allocation.
+ * data.copy(sb, 0, 0, 10);
+ *
+ * store.push(sb);
+ * }
+ * });
+ * ```
+ *
+ * A `TypeError` will be thrown if `size` is not a number.
+ * @since v5.12.0
+ * @param size The desired length of the new `Buffer`.
+ */
+ allocUnsafeSlow(size: number): Buffer;
+ /**
+ * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
+ * for pooling. This value may be modified.
+ * @since v0.11.3
+ */
+ poolSize: number;
+ }
+ interface Buffer extends Uint8Array {
+ /**
+ * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
+ * not contain enough space to fit the entire string, only part of `string` will be
+ * written. However, partially encoded characters will not be written.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.alloc(256);
+ *
+ * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
+ *
+ * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
+ * // Prints: 12 bytes: ½ + ¼ = ¾
+ *
+ * const buffer = Buffer.alloc(10);
+ *
+ * const length = buffer.write('abcd', 8);
+ *
+ * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
+ * // Prints: 2 bytes : ab
+ * ```
+ * @since v0.1.90
+ * @param string String to write to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write `string`.
+ * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
+ * @param [encoding='utf8'] The character encoding of `string`.
+ * @return Number of bytes written.
+ */
+ write(string: string, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
+ /**
+ * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
+ *
+ * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
+ * then each invalid byte is replaced with the replacement character `U+FFFD`.
+ *
+ * The maximum length of a string instance (in UTF-16 code units) is available
+ * as {@link constants.MAX_STRING_LENGTH}.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * console.log(buf1.toString('utf8'));
+ * // Prints: abcdefghijklmnopqrstuvwxyz
+ * console.log(buf1.toString('utf8', 0, 5));
+ * // Prints: abcde
+ *
+ * const buf2 = Buffer.from('tést');
+ *
+ * console.log(buf2.toString('hex'));
+ * // Prints: 74c3a97374
+ * console.log(buf2.toString('utf8', 0, 3));
+ * // Prints: té
+ * console.log(buf2.toString(undefined, 0, 3));
+ * // Prints: té
+ * ```
+ * @since v0.1.90
+ * @param [encoding='utf8'] The character encoding to use.
+ * @param [start=0] The byte offset to start decoding at.
+ * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
+ */
+ toString(encoding?: BufferEncoding, start?: number, end?: number): string;
+ /**
+ * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
+ * this function when stringifying a `Buffer` instance.
+ *
+ * `Buffer.from()` accepts objects in the format returned from this method.
+ * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
+ * const json = JSON.stringify(buf);
+ *
+ * console.log(json);
+ * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
+ *
+ * const copy = JSON.parse(json, (key, value) => {
+ * return value && value.type === 'Buffer' ?
+ * Buffer.from(value) :
+ * value;
+ * });
+ *
+ * console.log(copy);
+ * // Prints:
+ * ```
+ * @since v0.9.2
+ */
+ toJSON(): {
+ type: 'Buffer';
+ data: number[];
+ };
+ /**
+ * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('414243', 'hex');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.equals(buf2));
+ * // Prints: true
+ * console.log(buf1.equals(buf3));
+ * // Prints: false
+ * ```
+ * @since v0.11.13
+ * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ */
+ equals(otherBuffer: Uint8Array): boolean;
+ /**
+ * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
+ * Comparison is based on the actual sequence of bytes in each `Buffer`.
+ *
+ * * `0` is returned if `target` is the same as `buf`
+ * * `1` is returned if `target` should come _before_`buf` when sorted.
+ * * `-1` is returned if `target` should come _after_`buf` when sorted.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from('ABC');
+ * const buf2 = Buffer.from('BCD');
+ * const buf3 = Buffer.from('ABCD');
+ *
+ * console.log(buf1.compare(buf1));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2));
+ * // Prints: -1
+ * console.log(buf1.compare(buf3));
+ * // Prints: -1
+ * console.log(buf2.compare(buf1));
+ * // Prints: 1
+ * console.log(buf2.compare(buf3));
+ * // Prints: 1
+ * console.log([buf1, buf2, buf3].sort(Buffer.compare));
+ * // Prints: [ , , ]
+ * // (This result is equal to: [buf1, buf3, buf2].)
+ * ```
+ *
+ * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
+ *
+ * console.log(buf1.compare(buf2, 5, 9, 0, 4));
+ * // Prints: 0
+ * console.log(buf1.compare(buf2, 0, 6, 4));
+ * // Prints: -1
+ * console.log(buf1.compare(buf2, 5, 6, 5));
+ * // Prints: 1
+ * ```
+ *
+ * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
+ * @since v0.11.13
+ * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
+ * @param [targetStart=0] The offset within `target` at which to begin comparison.
+ * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
+ * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
+ */
+ compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ /**
+ * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
+ *
+ * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
+ * for all TypedArrays, including Node.js `Buffer`s, although it takes
+ * different function arguments.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create two `Buffer` instances.
+ * const buf1 = Buffer.allocUnsafe(26);
+ * const buf2 = Buffer.allocUnsafe(26).fill('!');
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
+ * buf1.copy(buf2, 8, 16, 20);
+ * // This is equivalent to:
+ * // buf2.set(buf1.subarray(16, 20), 8);
+ *
+ * console.log(buf2.toString('ascii', 0, 25));
+ * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
+ * ```
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` and copy data from one region to an overlapping region
+ * // within the same `Buffer`.
+ *
+ * const buf = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf[i] = i + 97;
+ * }
+ *
+ * buf.copy(buf, 0, 4, 10);
+ *
+ * console.log(buf.toString());
+ * // Prints: efghijghijklmnopqrstuvwxyz
+ * ```
+ * @since v0.1.90
+ * @param target A `Buffer` or {@link Uint8Array} to copy into.
+ * @param [targetStart=0] The offset within `target` at which to begin writing.
+ * @param [sourceStart=0] The offset within `buf` from which to begin copying.
+ * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
+ * @return The number of bytes copied.
+ */
+ copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * This is the same behavior as `buf.subarray()`.
+ *
+ * This method is not compatible with the `Uint8Array.prototype.slice()`,
+ * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * const copiedBuf = Uint8Array.prototype.slice.call(buf);
+ * copiedBuf[0]++;
+ * console.log(copiedBuf.toString());
+ * // Prints: cuffer
+ *
+ * console.log(buf.toString());
+ * // Prints: buffer
+ * ```
+ * @since v0.3.0
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ slice(start?: number, end?: number): Buffer;
+ /**
+ * Returns a new `Buffer` that references the same memory as the original, but
+ * offset and cropped by the `start` and `end` indices.
+ *
+ * Specifying `end` greater than `buf.length` will return the same result as
+ * that of `end` equal to `buf.length`.
+ *
+ * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
+ *
+ * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
+ * // from the original `Buffer`.
+ *
+ * const buf1 = Buffer.allocUnsafe(26);
+ *
+ * for (let i = 0; i < 26; i++) {
+ * // 97 is the decimal ASCII value for 'a'.
+ * buf1[i] = i + 97;
+ * }
+ *
+ * const buf2 = buf1.subarray(0, 3);
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: abc
+ *
+ * buf1[0] = 33;
+ *
+ * console.log(buf2.toString('ascii', 0, buf2.length));
+ * // Prints: !bc
+ * ```
+ *
+ * Specifying negative indexes causes the slice to be generated relative to the
+ * end of `buf` rather than the beginning.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * console.log(buf.subarray(-6, -1).toString());
+ * // Prints: buffe
+ * // (Equivalent to buf.subarray(0, 5).)
+ *
+ * console.log(buf.subarray(-6, -2).toString());
+ * // Prints: buff
+ * // (Equivalent to buf.subarray(0, 4).)
+ *
+ * console.log(buf.subarray(-5, -2).toString());
+ * // Prints: uff
+ * // (Equivalent to buf.subarray(1, 4).)
+ * ```
+ * @since v3.0.0
+ * @param [start=0] Where the new `Buffer` will start.
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
+ */
+ subarray(start?: number, end?: number): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64BE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigInt64LE(0x0102030405060708n, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigInt64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian.
+ *
+ * This function is also available under the `writeBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64BE(value: bigint, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ *
+ * This function is also available under the `writeBigUint64LE` alias.
+ * @since v12.0.0, v10.20.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeBigUInt64LE(value: bigint, offset?: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than an unsigned integer.
+ *
+ * This function is also available under the `writeUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeUIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
+ * when `value` is anything other than a signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntLE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntLE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
+ * signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(6);
+ *
+ * buf.writeIntBE(0x1234567890ab, 0, 6);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeIntBE(value: number, offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64BE(0));
+ * // Prints: 4294967295n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64BE(offset?: number): bigint;
+ /**
+ * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readBigUint64LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
+ *
+ * console.log(buf.readBigUInt64LE(0));
+ * // Prints: 18446744069414584320n
+ * ```
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigUInt64LE(offset?: number): bigint;
+ /**
+ * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64BE(offset?: number): bigint;
+ /**
+ * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed
+ * values.
+ * @since v12.0.0, v10.20.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
+ */
+ readBigInt64LE(offset?: number): bigint;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintLE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntLE(0, 6).toString(16));
+ * // Prints: ab9078563412
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting
+ * up to 48 bits of accuracy.
+ *
+ * This function is also available under the `readUintBE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readUIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readUIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readUIntBE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntLE(0, 6).toString(16));
+ * // Prints: -546f87a9cbee
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntLE(offset: number, byteLength: number): number;
+ /**
+ * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value
+ * supporting up to 48 bits of accuracy.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
+ *
+ * console.log(buf.readIntBE(0, 6).toString(16));
+ * // Prints: 1234567890ab
+ * console.log(buf.readIntBE(1, 6).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * console.log(buf.readIntBE(1, 0).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
+ * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
+ */
+ readIntBE(offset: number, byteLength: number): number;
+ /**
+ * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
+ *
+ * This function is also available under the `readUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, -2]);
+ *
+ * console.log(buf.readUInt8(0));
+ * // Prints: 1
+ * console.log(buf.readUInt8(1));
+ * // Prints: 254
+ * console.log(buf.readUInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readUInt8(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16LE(0).toString(16));
+ * // Prints: 3412
+ * console.log(buf.readUInt16LE(1).toString(16));
+ * // Prints: 5634
+ * console.log(buf.readUInt16LE(2).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56]);
+ *
+ * console.log(buf.readUInt16BE(0).toString(16));
+ * // Prints: 1234
+ * console.log(buf.readUInt16BE(1).toString(16));
+ * // Prints: 3456
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readUInt16BE(offset?: number): number;
+ /**
+ * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32LE(0).toString(16));
+ * // Prints: 78563412
+ * console.log(buf.readUInt32LE(1).toString(16));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32LE(offset?: number): number;
+ /**
+ * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * This function is also available under the `readUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
+ *
+ * console.log(buf.readUInt32BE(0).toString(16));
+ * // Prints: 12345678
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readUInt32BE(offset?: number): number;
+ /**
+ * Reads a signed 8-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([-1, 5]);
+ *
+ * console.log(buf.readInt8(0));
+ * // Prints: -1
+ * console.log(buf.readInt8(1));
+ * // Prints: 5
+ * console.log(buf.readInt8(2));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.0
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
+ */
+ readInt8(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16LE(0));
+ * // Prints: 1280
+ * console.log(buf.readInt16LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 5]);
+ *
+ * console.log(buf.readInt16BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
+ */
+ readInt16BE(offset?: number): number;
+ /**
+ * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32LE(0));
+ * // Prints: 83886080
+ * console.log(buf.readInt32LE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32LE(offset?: number): number;
+ /**
+ * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
+ *
+ * Integers read from a `Buffer` are interpreted as two's complement signed values.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([0, 0, 0, 5]);
+ *
+ * console.log(buf.readInt32BE(0));
+ * // Prints: 5
+ * ```
+ * @since v0.5.5
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readInt32BE(offset?: number): number;
+ /**
+ * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatLE(0));
+ * // Prints: 1.539989614439558e-36
+ * console.log(buf.readFloatLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatLE(offset?: number): number;
+ /**
+ * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4]);
+ *
+ * console.log(buf.readFloatBE(0));
+ * // Prints: 2.387939260590663e-38
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
+ */
+ readFloatBE(offset?: number): number;
+ /**
+ * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleLE(0));
+ * // Prints: 5.447603722011605e-270
+ * console.log(buf.readDoubleLE(1));
+ * // Throws ERR_OUT_OF_RANGE.
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleLE(offset?: number): number;
+ /**
+ * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
+ *
+ * console.log(buf.readDoubleBE(0));
+ * // Prints: 8.20788039913184e-304
+ * ```
+ * @since v0.11.15
+ * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
+ */
+ readDoubleBE(offset?: number): number;
+ reverse(): this;
+ /**
+ * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * buf1.swap16();
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap16();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ *
+ * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
+ * between UTF-16 little-endian and UTF-16 big-endian:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
+ * buf.swap16(); // Convert to big-endian UTF-16 text.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap16(): Buffer;
+ /**
+ * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
+ * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * buf1.swap32();
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap32();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v5.10.0
+ * @return A reference to `buf`.
+ */
+ swap32(): Buffer;
+ /**
+ * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
+ * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * buf1.swap64();
+ *
+ * console.log(buf1);
+ * // Prints:
+ *
+ * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
+ *
+ * buf2.swap64();
+ * // Throws ERR_INVALID_BUFFER_SIZE.
+ * ```
+ * @since v6.3.0
+ * @return A reference to `buf`.
+ */
+ swap64(): Buffer;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a
+ * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
+ * other than an unsigned 8-bit integer.
+ *
+ * This function is also available under the `writeUint8` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt8(0x3, 0);
+ * buf.writeUInt8(0x4, 1);
+ * buf.writeUInt8(0x23, 2);
+ * buf.writeUInt8(0x42, 3);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16LE(0xdead, 0);
+ * buf.writeUInt16LE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 16-bit integer.
+ *
+ * This function is also available under the `writeUint16BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt16BE(0xdead, 0);
+ * buf.writeUInt16BE(0xbeef, 2);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
+ * anything other than an unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32LE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32LE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
+ * unsigned 32-bit integer.
+ *
+ * This function is also available under the `writeUint32BE` alias.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeUInt32BE(0xfeedface, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeUInt32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
+ * signed 8-bit integer. Behavior is undefined when `value` is anything other than
+ * a signed 8-bit integer.
+ *
+ * `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt8(2, 0);
+ * buf.writeInt8(-2, 1);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.0
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt8(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16LE(0x0304, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 16-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(2);
+ *
+ * buf.writeInt16BE(0x0102, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt16BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32LE(0x05060708, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32LE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
+ * anything other than a signed 32-bit integer.
+ *
+ * The `value` is interpreted and written as a two's complement signed integer.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeInt32BE(0x01020304, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.5.5
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeInt32BE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatLE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
+ * undefined when `value` is anything other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(4);
+ *
+ * buf.writeFloatBE(0xcafebabe, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeFloatBE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleLE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleLE(value: number, offset?: number): number;
+ /**
+ * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
+ * other than a JavaScript number.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(8);
+ *
+ * buf.writeDoubleBE(123.456, 0);
+ *
+ * console.log(buf);
+ * // Prints:
+ * ```
+ * @since v0.11.15
+ * @param value Number to be written to `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
+ * @return `offset` plus the number of bytes written.
+ */
+ writeDoubleBE(value: number, offset?: number): number;
+ /**
+ * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
+ * the entire `buf` will be filled:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with the ASCII character 'h'.
+ *
+ * const b = Buffer.allocUnsafe(50).fill('h');
+ *
+ * console.log(b.toString());
+ * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+ * ```
+ *
+ * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
+ * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
+ * filled with `value & 255`.
+ *
+ * If the final write of a `fill()` operation falls on a multi-byte character,
+ * then only the bytes of that character that fit into `buf` are written:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
+ *
+ * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
+ * // Prints:
+ * ```
+ *
+ * If `value` contains invalid characters, it is truncated; if no valid
+ * fill data remains, an exception is thrown:
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.allocUnsafe(5);
+ *
+ * console.log(buf.fill('a'));
+ * // Prints:
+ * console.log(buf.fill('aazz', 'hex'));
+ * // Prints:
+ * console.log(buf.fill('zz', 'hex'));
+ * // Throws an exception.
+ * ```
+ * @since v0.5.0
+ * @param value The value with which to fill `buf`.
+ * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
+ * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
+ * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
+ * @return A reference to `buf`.
+ */
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
+ /**
+ * If `value` is:
+ *
+ * * a string, `value` is interpreted according to the character encoding in`encoding`.
+ * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
+ * To compare a partial `Buffer`, use `buf.slice()`.
+ * * a number, `value` will be interpreted as an unsigned 8-bit integer
+ * value between `0` and `255`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.indexOf('this'));
+ * // Prints: 0
+ * console.log(buf.indexOf('is'));
+ * // Prints: 2
+ * console.log(buf.indexOf(Buffer.from('a buffer')));
+ * // Prints: 8
+ * console.log(buf.indexOf(97));
+ * // Prints: 8 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.indexOf(Buffer.from('a buffer example')));
+ * // Prints: -1
+ * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: 8
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
+ * // Prints: 4
+ * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
+ * // Prints: 6
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. If the result
+ * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
+ * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.indexOf(99.9));
+ * console.log(b.indexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN or 0.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.indexOf('b', undefined));
+ * console.log(b.indexOf('b', {}));
+ * console.log(b.indexOf('b', null));
+ * console.log(b.indexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
+ * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
+ * @since v1.5.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
+ * rather than the first occurrence.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this buffer is a buffer');
+ *
+ * console.log(buf.lastIndexOf('this'));
+ * // Prints: 0
+ * console.log(buf.lastIndexOf('buffer'));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(Buffer.from('buffer')));
+ * // Prints: 17
+ * console.log(buf.lastIndexOf(97));
+ * // Prints: 15 (97 is the decimal ASCII value for 'a')
+ * console.log(buf.lastIndexOf(Buffer.from('yolo')));
+ * // Prints: -1
+ * console.log(buf.lastIndexOf('buffer', 5));
+ * // Prints: 5
+ * console.log(buf.lastIndexOf('buffer', 4));
+ * // Prints: -1
+ *
+ * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
+ *
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
+ * // Prints: 6
+ * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
+ * // Prints: 4
+ * ```
+ *
+ * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
+ * an integer between 0 and 255.
+ *
+ * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
+ * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
+ * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const b = Buffer.from('abcdef');
+ *
+ * // Passing a value that's a number, but not a valid byte.
+ * // Prints: 2, equivalent to searching for 99 or 'c'.
+ * console.log(b.lastIndexOf(99.9));
+ * console.log(b.lastIndexOf(256 + 99));
+ *
+ * // Passing a byteOffset that coerces to NaN.
+ * // Prints: 1, searching the whole buffer.
+ * console.log(b.lastIndexOf('b', undefined));
+ * console.log(b.lastIndexOf('b', {}));
+ *
+ * // Passing a byteOffset that coerces to 0.
+ * // Prints: -1, equivalent to passing 0.
+ * console.log(b.lastIndexOf('b', null));
+ * console.log(b.lastIndexOf('b', []));
+ * ```
+ *
+ * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
+ * @since v6.0.0
+ * @param value What to search for.
+ * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
+ * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
+ */
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
+ * of `buf`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * // Log the entire contents of a `Buffer`.
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const pair of buf.entries()) {
+ * console.log(pair);
+ * }
+ * // Prints:
+ * // [0, 98]
+ * // [1, 117]
+ * // [2, 102]
+ * // [3, 102]
+ * // [4, 101]
+ * // [5, 114]
+ * ```
+ * @since v1.1.0
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Equivalent to `buf.indexOf() !== -1`.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('this is a buffer');
+ *
+ * console.log(buf.includes('this'));
+ * // Prints: true
+ * console.log(buf.includes('is'));
+ * // Prints: true
+ * console.log(buf.includes(Buffer.from('a buffer')));
+ * // Prints: true
+ * console.log(buf.includes(97));
+ * // Prints: true (97 is the decimal ASCII value for 'a')
+ * console.log(buf.includes(Buffer.from('a buffer example')));
+ * // Prints: false
+ * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
+ * // Prints: true
+ * console.log(buf.includes('this', 4));
+ * // Prints: false
+ * ```
+ * @since v5.3.0
+ * @param value What to search for.
+ * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
+ * @param [encoding='utf8'] If `value` is a string, this is its encoding.
+ * @return `true` if `value` was found in `buf`, `false` otherwise.
+ */
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const key of buf.keys()) {
+ * console.log(key);
+ * }
+ * // Prints:
+ * // 0
+ * // 1
+ * // 2
+ * // 3
+ * // 4
+ * // 5
+ * ```
+ * @since v1.1.0
+ */
+ keys(): IterableIterator;
+ /**
+ * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
+ * called automatically when a `Buffer` is used in a `for..of` statement.
+ *
+ * ```js
+ * import { Buffer } from 'buffer';
+ *
+ * const buf = Buffer.from('buffer');
+ *
+ * for (const value of buf.values()) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ *
+ * for (const value of buf) {
+ * console.log(value);
+ * }
+ * // Prints:
+ * // 98
+ * // 117
+ * // 102
+ * // 102
+ * // 101
+ * // 114
+ * ```
+ * @since v1.1.0
+ */
+ values(): IterableIterator;
+ }
+ var Buffer: BufferConstructor;
+ /**
+ * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
+ * into a string using Latin-1 (ISO-8859-1).
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0
+ * @deprecated Use `Buffer.from(data, 'base64')` instead.
+ * @param data The Base64-encoded input string.
+ */
+ function atob(data: string): string;
+ /**
+ * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
+ * into a string using Base64.
+ *
+ * The `data` may be any JavaScript-value that can be coerced into a string.
+ *
+ * **This function is only provided for compatibility with legacy web platform APIs**
+ * **and should never be used in new code, because they use strings to represent**
+ * **binary data and predate the introduction of typed arrays in JavaScript.**
+ * **For code running using Node.js APIs, converting between base64-encoded strings**
+ * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
+ * @since v15.13.0
+ * @deprecated Use `buf.toString('base64')` instead.
+ * @param data An ASCII (Latin1) string.
+ */
+ function btoa(data: string): string;
+ }
+}
+declare module 'node:buffer' {
+ export * from 'buffer';
+}
diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts
new file mode 100644
index 0000000..d383145
--- /dev/null
+++ b/node_modules/@types/node/child_process.d.ts
@@ -0,0 +1,1366 @@
+/**
+ * The `child_process` module provides the ability to spawn subprocesses in
+ * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
+ * is primarily provided by the {@link spawn} function:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
+ * the parent Node.js process and the spawned subprocess. These pipes have
+ * limited (and platform-specific) capacity. If the subprocess writes to
+ * stdout in excess of that limit without the output being captured, the
+ * subprocess blocks waiting for the pipe buffer to accept more data. This is
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
+ *
+ * The command lookup is performed using the `options.env.PATH` environment
+ * variable if it is in the `options` object. Otherwise, `process.env.PATH` is
+ * used.
+ *
+ * On Windows, environment variables are case-insensitive. Node.js
+ * lexicographically sorts the `env` keys and uses the first one that
+ * case-insensitively matches. Only first (in lexicographic order) entry will be
+ * passed to the subprocess. This might lead to issues on Windows when passing
+ * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
+ *
+ * The {@link spawn} method spawns the child process asynchronously,
+ * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
+ * the event loop until the spawned process either exits or is terminated.
+ *
+ * For convenience, the `child_process` module provides a handful of synchronous
+ * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
+ * top of {@link spawn} or {@link spawnSync}.
+ *
+ * * {@link exec}: spawns a shell and runs a command within that
+ * shell, passing the `stdout` and `stderr` to a callback function when
+ * complete.
+ * * {@link execFile}: similar to {@link exec} except
+ * that it spawns the command directly without first spawning a shell by
+ * default.
+ * * {@link fork}: spawns a new Node.js process and invokes a
+ * specified module with an IPC communication channel established that allows
+ * sending messages between parent and child.
+ * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
+ * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
+ *
+ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
+ * the synchronous methods can have significant impact on performance due to
+ * stalling the event loop while spawned processes complete.
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/child_process.js)
+ */
+declare module 'child_process' {
+ import { ObjectEncodingOptions } from 'node:fs';
+ import { EventEmitter, Abortable } from 'node:events';
+ import * as net from 'node:net';
+ import { Writable, Readable, Stream, Pipe } from 'node:stream';
+ import { URL } from 'node:url';
+ type Serializable = string | object | number | boolean | bigint;
+ type SendHandle = net.Socket | net.Server;
+ /**
+ * Instances of the `ChildProcess` represent spawned child processes.
+ *
+ * Instances of `ChildProcess` are not intended to be created directly. Rather,
+ * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
+ * instances of `ChildProcess`.
+ * @since v2.2.0
+ */
+ class ChildProcess extends EventEmitter {
+ /**
+ * A `Writable Stream` that represents the child process's `stdin`.
+ *
+ * If a child process waits to read all of its input, the child will not continue
+ * until this stream has been closed via `end()`.
+ *
+ * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stdin` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdin: Writable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stdout`.
+ *
+ * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will
+ * refer to the same value.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn('ls');
+ *
+ * subprocess.stdout.on('data', (data) => {
+ * console.log(`Received chunk ${data}`);
+ * });
+ * ```
+ *
+ * The `subprocess.stdout` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stdout: Readable | null;
+ /**
+ * A `Readable Stream` that represents the child process's `stderr`.
+ *
+ * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`,
+ * then this will be `null`.
+ *
+ * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
+ * refer to the same value.
+ *
+ * The `subprocess.stderr` property can be `null` if the child process could
+ * not be successfully spawned.
+ * @since v0.1.90
+ */
+ stderr: Readable | null;
+ /**
+ * The `subprocess.channel` property is a reference to the child's IPC channel. If
+ * no IPC channel currently exists, this property is `undefined`.
+ * @since v7.1.0
+ */
+ readonly channel?: Pipe | null | undefined;
+ /**
+ * A sparse array of pipes to the child process, corresponding with positions in
+ * the `stdio` option passed to {@link spawn} that have been set
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
+ * respectively.
+ *
+ * In the following example, only the child's fd `1` (stdout) is configured as a
+ * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values
+ * in the array are `null`.
+ *
+ * ```js
+ * const assert = require('assert');
+ * const fs = require('fs');
+ * const child_process = require('child_process');
+ *
+ * const subprocess = child_process.spawn('ls', {
+ * stdio: [
+ * 0, // Use parent's stdin for child.
+ * 'pipe', // Pipe child's stdout to parent.
+ * fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
+ * ]
+ * });
+ *
+ * assert.strictEqual(subprocess.stdio[0], null);
+ * assert.strictEqual(subprocess.stdio[0], subprocess.stdin);
+ *
+ * assert(subprocess.stdout);
+ * assert.strictEqual(subprocess.stdio[1], subprocess.stdout);
+ *
+ * assert.strictEqual(subprocess.stdio[2], null);
+ * assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
+ * ```
+ *
+ * The `subprocess.stdio` property can be `undefined` if the child process could
+ * not be successfully spawned.
+ * @since v0.7.10
+ */
+ readonly stdio: [
+ Writable | null,
+ // stdin
+ Readable | null,
+ // stdout
+ Readable | null,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra
+ Readable | Writable | null | undefined // extra
+ ];
+ /**
+ * The `subprocess.killed` property indicates whether the child process
+ * successfully received a signal from `subprocess.kill()`. The `killed` property
+ * does not indicate that the child process has been terminated.
+ * @since v0.5.10
+ */
+ readonly killed: boolean;
+ /**
+ * Returns the process identifier (PID) of the child process. If the child process
+ * fails to spawn due to errors, then the value is `undefined` and `error` is
+ * emitted.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * console.log(`Spawned child pid: ${grep.pid}`);
+ * grep.stdin.end();
+ * ```
+ * @since v0.1.90
+ */
+ readonly pid?: number | undefined;
+ /**
+ * The `subprocess.connected` property indicates whether it is still possible to
+ * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
+ * @since v0.7.2
+ */
+ readonly connected: boolean;
+ /**
+ * The `subprocess.exitCode` property indicates the exit code of the child process.
+ * If the child process is still running, the field will be `null`.
+ */
+ readonly exitCode: number | null;
+ /**
+ * The `subprocess.signalCode` property indicates the signal received by
+ * the child process if any, else `null`.
+ */
+ readonly signalCode: NodeJS.Signals | null;
+ /**
+ * The `subprocess.spawnargs` property represents the full list of command-line
+ * arguments the child process was launched with.
+ */
+ readonly spawnargs: string[];
+ /**
+ * The `subprocess.spawnfile` property indicates the executable file name of
+ * the child process that is launched.
+ *
+ * For {@link fork}, its value will be equal to `process.execPath`.
+ * For {@link spawn}, its value will be the name of
+ * the executable file.
+ * For {@link exec}, its value will be the name of the shell
+ * in which the child process is launched.
+ */
+ readonly spawnfile: string;
+ /**
+ * The `subprocess.kill()` method sends a signal to the child process. If no
+ * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
+ * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * grep.on('close', (code, signal) => {
+ * console.log(
+ * `child process terminated due to receipt of signal ${signal}`);
+ * });
+ *
+ * // Send SIGHUP to process.
+ * grep.kill('SIGHUP');
+ * ```
+ *
+ * The `ChildProcess` object may emit an `'error'` event if the signal
+ * cannot be delivered. Sending a signal to a child process that has already exited
+ * is not an error but may have unforeseen consequences. Specifically, if the
+ * process identifier (PID) has been reassigned to another process, the signal will
+ * be delivered to that process instead which can have unexpected results.
+ *
+ * While the function is called `kill`, the signal delivered to the child process
+ * may not actually terminate the process.
+ *
+ * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
+ *
+ * On Windows, where POSIX signals do not exist, the `signal` argument will be
+ * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
+ * See `Signal Events` for more details.
+ *
+ * On Linux, child processes of child processes will not be terminated
+ * when attempting to kill their parent. This is likely to happen when running a
+ * new process in a shell or with the use of the `shell` option of `ChildProcess`:
+ *
+ * ```js
+ * 'use strict';
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(
+ * 'sh',
+ * [
+ * '-c',
+ * `node -e "setInterval(() => {
+ * console.log(process.pid, 'is alive')
+ * }, 500);"`,
+ * ], {
+ * stdio: ['inherit', 'inherit', 'inherit']
+ * }
+ * );
+ *
+ * setTimeout(() => {
+ * subprocess.kill(); // Does not terminate the Node.js process in the shell.
+ * }, 2000);
+ * ```
+ * @since v0.1.90
+ */
+ kill(signal?: NodeJS.Signals | number): boolean;
+ /**
+ * When an IPC channel has been established between the parent and child (
+ * i.e. when using {@link fork}), the `subprocess.send()` method can
+ * be used to send messages to the child process. When the child process is a
+ * Node.js instance, these messages can be received via the `'message'` event.
+ *
+ * The message goes through serialization and parsing. The resulting
+ * message might not be the same as what is originally sent.
+ *
+ * For example, in the parent script:
+ *
+ * ```js
+ * const cp = require('child_process');
+ * const n = cp.fork(`${__dirname}/sub.js`);
+ *
+ * n.on('message', (m) => {
+ * console.log('PARENT got message:', m);
+ * });
+ *
+ * // Causes the child to print: CHILD got message: { hello: 'world' }
+ * n.send({ hello: 'world' });
+ * ```
+ *
+ * And then the child script, `'sub.js'` might look like this:
+ *
+ * ```js
+ * process.on('message', (m) => {
+ * console.log('CHILD got message:', m);
+ * });
+ *
+ * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }
+ * process.send({ foo: 'bar', baz: NaN });
+ * ```
+ *
+ * Child Node.js processes will have a `process.send()` method of their own
+ * that allows the child to send messages back to the parent.
+ *
+ * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
+ * containing a `NODE_` prefix in the `cmd` property are reserved for use within
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
+ * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
+ *
+ * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
+ * for passing a TCP server or socket object to the child process. The child will
+ * receive the object as the second argument passed to the callback function
+ * registered on the `'message'` event. Any data that is received
+ * and buffered in the socket will not be sent to the child.
+ *
+ * The optional `callback` is a function that is invoked after the message is
+ * sent but before the child may have received it. The function is called with a
+ * single argument: `null` on success, or an `Error` object on failure.
+ *
+ * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
+ * happen, for instance, when the child process has already exited.
+ *
+ * `subprocess.send()` will return `false` if the channel has closed or when the
+ * backlog of unsent messages exceeds a threshold that makes it unwise to send
+ * more. Otherwise, the method returns `true`. The `callback` function can be
+ * used to implement flow control.
+ *
+ * #### Example: sending a server object
+ *
+ * The `sendHandle` argument can be used, for instance, to pass the handle of
+ * a TCP server object to the child process as illustrated in the example below:
+ *
+ * ```js
+ * const subprocess = require('child_process').fork('subprocess.js');
+ *
+ * // Open up the server object and send the handle.
+ * const server = require('net').createServer();
+ * server.on('connection', (socket) => {
+ * socket.end('handled by parent');
+ * });
+ * server.listen(1337, () => {
+ * subprocess.send('server', server);
+ * });
+ * ```
+ *
+ * The child would then receive the server object as:
+ *
+ * ```js
+ * process.on('message', (m, server) => {
+ * if (m === 'server') {
+ * server.on('connection', (socket) => {
+ * socket.end('handled by child');
+ * });
+ * }
+ * });
+ * ```
+ *
+ * Once the server is now shared between the parent and child, some connections
+ * can be handled by the parent and some by the child.
+ *
+ * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on
+ * a `'message'` event instead of `'connection'` and using `server.bind()` instead
+ * of `server.listen()`. This is, however, currently only supported on Unix
+ * platforms.
+ *
+ * #### Example: sending a socket object
+ *
+ * Similarly, the `sendHandler` argument can be used to pass the handle of a
+ * socket to the child process. The example below spawns two children that each
+ * handle connections with "normal" or "special" priority:
+ *
+ * ```js
+ * const { fork } = require('child_process');
+ * const normal = fork('subprocess.js', ['normal']);
+ * const special = fork('subprocess.js', ['special']);
+ *
+ * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
+ * // the sockets from being read before they are sent to the child process.
+ * const server = require('net').createServer({ pauseOnConnect: true });
+ * server.on('connection', (socket) => {
+ *
+ * // If this is special priority...
+ * if (socket.remoteAddress === '74.125.127.100') {
+ * special.send('socket', socket);
+ * return;
+ * }
+ * // This is normal priority.
+ * normal.send('socket', socket);
+ * });
+ * server.listen(1337);
+ * ```
+ *
+ * The `subprocess.js` would receive the socket handle as the second argument
+ * passed to the event callback function:
+ *
+ * ```js
+ * process.on('message', (m, socket) => {
+ * if (m === 'socket') {
+ * if (socket) {
+ * // Check that the client socket exists.
+ * // It is possible for the socket to be closed between the time it is
+ * // sent and the time it is received in the child process.
+ * socket.end(`Request handled with ${process.argv[2]} priority`);
+ * }
+ * }
+ * });
+ * ```
+ *
+ * Do not use `.maxConnections` on a socket that has been passed to a subprocess.
+ * The parent cannot track when the socket is destroyed.
+ *
+ * Any `'message'` handlers in the subprocess should verify that `socket` exists,
+ * as the connection may have been closed during the time it takes to send the
+ * connection to the child.
+ * @since v0.5.9
+ * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
+ */
+ send(message: Serializable, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
+ /**
+ * Closes the IPC channel between parent and child, allowing the child to exit
+ * gracefully once there are no other connections keeping it alive. After calling
+ * this method the `subprocess.connected` and `process.connected` properties in
+ * both the parent and child (respectively) will be set to `false`, and it will be
+ * no longer possible to pass messages between the processes.
+ *
+ * The `'disconnect'` event will be emitted when there are no messages in the
+ * process of being received. This will most often be triggered immediately after
+ * calling `subprocess.disconnect()`.
+ *
+ * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked
+ * within the child process to close the IPC channel as well.
+ * @since v0.7.2
+ */
+ disconnect(): void;
+ /**
+ * By default, the parent will wait for the detached child to exit. To prevent the
+ * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
+ * include the child in its reference count, allowing the parent to exit
+ * independently of the child, unless there is an established IPC channel between
+ * the child and the parent.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * ```
+ * @since v0.7.10
+ */
+ unref(): void;
+ /**
+ * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will
+ * restore the removed reference count for the child process, forcing the parent
+ * to wait for the child to exit before exiting itself.
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ *
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
+ * detached: true,
+ * stdio: 'ignore'
+ * });
+ *
+ * subprocess.unref();
+ * subprocess.ref();
+ * ```
+ * @since v0.7.10
+ */
+ ref(): void;
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. disconnect
+ * 3. error
+ * 4. exit
+ * 5. message
+ * 6. spawn
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: 'disconnect', listener: () => void): this;
+ addListener(event: 'error', listener: (err: Error) => void): this;
+ addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ addListener(event: 'spawn', listener: () => void): this;
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: 'disconnect'): boolean;
+ emit(event: 'error', err: Error): boolean;
+ emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean;
+ emit(event: 'spawn', listener: () => void): boolean;
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: 'disconnect', listener: () => void): this;
+ on(event: 'error', listener: (err: Error) => void): this;
+ on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ on(event: 'spawn', listener: () => void): this;
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: 'disconnect', listener: () => void): this;
+ once(event: 'error', listener: (err: Error) => void): this;
+ once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ once(event: 'spawn', listener: () => void): this;
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: 'disconnect', listener: () => void): this;
+ prependListener(event: 'error', listener: (err: Error) => void): this;
+ prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependListener(event: 'spawn', listener: () => void): this;
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependOnceListener(event: 'disconnect', listener: () => void): this;
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
+ prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependOnceListener(event: 'spawn', listener: () => void): this;
+ }
+ // return this object when stdio option is undefined or not specified
+ interface ChildProcessWithoutNullStreams extends ChildProcess {
+ stdin: Writable;
+ stdout: Readable;
+ stderr: Readable;
+ readonly stdio: [
+ Writable,
+ Readable,
+ Readable,
+ // stderr
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined // extra, no modification
+ ];
+ }
+ // return this object when stdio option is a tuple of 3
+ interface ChildProcessByStdio extends ChildProcess {
+ stdin: I;
+ stdout: O;
+ stderr: E;
+ readonly stdio: [
+ I,
+ O,
+ E,
+ Readable | Writable | null | undefined,
+ // extra, no modification
+ Readable | Writable | null | undefined // extra, no modification
+ ];
+ }
+ interface MessageOptions {
+ keepOpen?: boolean | undefined;
+ }
+ type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit';
+ type StdioOptions = IOType | Array;
+ type SerializationType = 'json' | 'advanced';
+ interface MessagingOptions extends Abortable {
+ /**
+ * Specify the kind of serialization used for sending messages between processes.
+ * @default 'json'
+ */
+ serialization?: SerializationType | undefined;
+ /**
+ * The signal value to be used when the spawned process will be killed by the abort signal.
+ * @default 'SIGTERM'
+ */
+ killSignal?: NodeJS.Signals | number | undefined;
+ /**
+ * In milliseconds the maximum amount of time the process is allowed to run.
+ */
+ timeout?: number | undefined;
+ }
+ interface ProcessEnvOptions {
+ uid?: number | undefined;
+ gid?: number | undefined;
+ cwd?: string | URL | undefined;
+ env?: NodeJS.ProcessEnv | undefined;
+ }
+ interface CommonOptions extends ProcessEnvOptions {
+ /**
+ * @default true
+ */
+ windowsHide?: boolean | undefined;
+ /**
+ * @default 0
+ */
+ timeout?: number | undefined;
+ }
+ interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
+ argv0?: string | undefined;
+ stdio?: StdioOptions | undefined;
+ shell?: boolean | string | undefined;
+ windowsVerbatimArguments?: boolean | undefined;
+ }
+ interface SpawnOptions extends CommonSpawnOptions {
+ detached?: boolean | undefined;
+ }
+ interface SpawnOptionsWithoutStdio extends SpawnOptions {
+ stdio?: StdioPipeNamed | StdioPipe[] | undefined;
+ }
+ type StdioNull = 'inherit' | 'ignore' | Stream;
+ type StdioPipeNamed = 'pipe' | 'overlapped';
+ type StdioPipe = undefined | null | StdioPipeNamed;
+ interface SpawnOptionsWithStdioTuple extends SpawnOptions {
+ stdio: [Stdin, Stdout, Stderr];
+ }
+ /**
+ * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
+ * to an empty array.
+ *
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
+ * **function. Any input containing shell metacharacters may be used to trigger**
+ * **arbitrary command execution.**
+ *
+ * A third argument may be used to specify additional options, with these defaults:
+ *
+ * ```js
+ * const defaults = {
+ * cwd: undefined,
+ * env: process.env
+ * };
+ * ```
+ *
+ * Use `cwd` to specify the working directory from which the process is spawned.
+ * If not given, the default is to inherit the current working directory. If given,
+ * but the path does not exist, the child process emits an `ENOENT` error
+ * and exits immediately. `ENOENT` is also emitted when the command
+ * does not exist.
+ *
+ * Use `env` to specify environment variables that will be visible to the new
+ * process, the default is `process.env`.
+ *
+ * `undefined` values in `env` will be ignored.
+ *
+ * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the
+ * exit code:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ls = spawn('ls', ['-lh', '/usr']);
+ *
+ * ls.stdout.on('data', (data) => {
+ * console.log(`stdout: ${data}`);
+ * });
+ *
+ * ls.stderr.on('data', (data) => {
+ * console.error(`stderr: ${data}`);
+ * });
+ *
+ * ls.on('close', (code) => {
+ * console.log(`child process exited with code ${code}`);
+ * });
+ * ```
+ *
+ * Example: A very elaborate way to run `ps ax | grep ssh`
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const ps = spawn('ps', ['ax']);
+ * const grep = spawn('grep', ['ssh']);
+ *
+ * ps.stdout.on('data', (data) => {
+ * grep.stdin.write(data);
+ * });
+ *
+ * ps.stderr.on('data', (data) => {
+ * console.error(`ps stderr: ${data}`);
+ * });
+ *
+ * ps.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`ps process exited with code ${code}`);
+ * }
+ * grep.stdin.end();
+ * });
+ *
+ * grep.stdout.on('data', (data) => {
+ * console.log(data.toString());
+ * });
+ *
+ * grep.stderr.on('data', (data) => {
+ * console.error(`grep stderr: ${data}`);
+ * });
+ *
+ * grep.on('close', (code) => {
+ * if (code !== 0) {
+ * console.log(`grep process exited with code ${code}`);
+ * }
+ * });
+ * ```
+ *
+ * Example of checking for failed `spawn`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const subprocess = spawn('bad_command');
+ *
+ * subprocess.on('error', (err) => {
+ * console.error('Failed to start subprocess.');
+ * });
+ * ```
+ *
+ * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
+ * title while others (Windows, SunOS) will use `command`.
+ *
+ * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent,
+ * retrieve it with the`process.argv0` property instead.
+ *
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
+ * the error passed to the callback will be an `AbortError`:
+ *
+ * ```js
+ * const { spawn } = require('child_process');
+ * const controller = new AbortController();
+ * const { signal } = controller;
+ * const grep = spawn('grep', ['ssh'], { signal });
+ * grep.on('error', (err) => {
+ * // This will be called with err being an AbortError if the controller aborts
+ * });
+ * controller.abort(); // Stops the child process
+ * ```
+ * @since v0.1.90
+ * @param command The command to run.
+ * @param args List of string arguments.
+ */
+ function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple